Add local store auth summary API#7709
Conversation
92fffc1 to
c7e152d
Compare
619636c to
7c049c1
Compare
3ac3560 to
6fbe857
Compare
7c049c1 to
52daf1c
Compare
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
6fbe857 to
87919a9
Compare
00dce2a to
22e4f4a
Compare
f516bbe to
79dbfa7
Compare
22e4f4a to
31a07f1
Compare
79dbfa7 to
9e07ceb
Compare
c128517 to
9343914
Compare
5986997 to
b4c7faa
Compare
9343914 to
81229e4
Compare
b4c7faa to
cb1e68e
Compare
81229e4 to
04b87d7
Compare
cb1e68e to
4a2c0dd
Compare
04b87d7 to
b3f03fe
Compare
4a2c0dd to
0974dfd
Compare
b3f03fe to
6246aef
Compare
8d4afd4 to
a2cf41b
Compare
5cc2126 to
4075110
Compare
a2cf41b to
541a4a4
Compare
4075110 to
cd562c1
Compare
541a4a4 to
a053144
Compare
cd562c1 to
8dd1001
Compare
9f582a7 to
9649fc5
Compare
6e10c3a to
000cd81
Compare
9649fc5 to
a151039
Compare
000cd81 to
8a8afc2
Compare
a151039 to
3755b76
Compare
| ...(sanitizeAssociatedUser(session.associatedUser) | ||
| ? {associatedUser: sanitizeAssociatedUser(session.associatedUser)} | ||
| : {}), | ||
| ...(associatedUser ? {associatedUser} : {}), |
| // `conf` persists dotted keys as nested objects. Store-auth callers should not | ||
| // learn that layout directly; this helper keeps the current traversal private to | ||
| // the persistence seam while higher-level code projects summaries instead. | ||
| function readRawStoreSessionStorage(storage: LocalStorage<StoreSessionSchema>): Record<string, unknown> { |
There was a problem hiding this comment.
Do these need to be unknowns? Would a union type be possible?
| return (storage as unknown as {config: {store: Record<string, unknown>}}).config.store ?? {} | ||
| } | ||
|
|
||
| function collectCurrentStoredStoreAppSessions( |
There was a problem hiding this comment.
This function is kind of an abomination. I would strongly prefer that we have a background task that fixes the storage once (e.g. foo.myshopify.com => foo-myshopify-com) and then we can avoid this complexity going forward.
By the way, we don't really test this crawling logic anywhere if I am understanding correctly.
8a8afc2 to
67cfc8b
Compare
538642c to
a94504a
Compare
a94504a to
0c53a33
Compare
0c53a33 to
b61793b
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/common/string.d.ts@@ -102,6 +102,16 @@ export declare function formatDate(date: Date): string;
* @returns The transformed string in local system time.
*/
export declare function formatLocalDate(dateString: string): string;
+/**
+ * Formats a date as a short calendar date like "May 22, 2026" () in UTC.
+ *
+ * UTC keeps the output deterministic regardless of the machine timezone. Returns an empty string
+ * when the value cannot be parsed into a valid date.
+ *
+ * @param value - A Date, epoch milliseconds, or a date string such as an ISO 8601 timestamp.
+ * @returns The formatted date, or an empty string when the value is invalid.
+ */
+export declare function formatShortDate(value: Date | number | string): string;
/**
* Given a list of items, it returns a string with the items joined by commas and the last item joined by "and".
* All items are wrapped in double quotes.
packages/cli-kit/dist/public/common/url.d.ts@@ -28,4 +28,13 @@ export declare function extractHost(value: string | null | undefined): string |
* @param value - A URL or host string, possibly null/undefined.
* @returns The myshopify subdomain handle, or undefined when the input isn't a URL.
*/
-export declare function extractMyshopifyHandle(value: string | null | undefined): string | undefined;
\ No newline at end of file
+export declare function extractMyshopifyHandle(value: string | null | undefined): string | undefined;
+/**
+ * Extracts the leading subdomain label from a URL or host, across environments — e.g.
+ * , , or local development hosts — rather than assuming a
+ * domain.
+ *
+ * @param value - A URL or host string, possibly null/undefined.
+ * @returns The first DNS label, or undefined when no host can be extracted.
+ */
+export declare function extractSubdomain(value: string | null | undefined): string | undefined;
\ No newline at end of file
|

Summary
Introduce a local store-auth summary API without changing command behavior yet.
Scope
StoredStoreAuthSummarylistStoredStoreAuthSummaries()underservices/store/authconftraversal and bucket cleanup insession-store.tsservices/store/auth/index.tsWhy this split exists
The next PR needs one narrow question answered first:
This PR answers that without taking on product behavior:
That keeps the behavior PR focused on command policy and output, not on storage traversal.
Boundary this PR is trying to establish
session-store.tsStoredStoreAuthSummary[]conflayout knowledgeNot changed / deferred
shopify auth listcommand in this PR. This PR is only the storage projection; command behavior lands upstack.LocalStorage.entries()/ enumeration API in cli-kit. Follow-through review correctly noted thatsession-store.tsstill relies on the underlyingconflayout to discover existing buckets; fixing that should be a focused storage follow-up before adding more local-auth inventory features.