instant-cli 1.0.22 → 1.0.23-branch-cli-codex-update.25390498340.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/__tests__/authClientAddGoogle.test.ts +92 -0
  3. package/__tests__/authClientList.test.ts +90 -0
  4. package/__tests__/authClientUpdate.test.ts +583 -0
  5. package/__tests__/oauthMock.ts +9 -1
  6. package/__tests__/redirectUriPrompt.test.ts +26 -0
  7. package/dist/commands/auth/client/add.d.ts +1 -2
  8. package/dist/commands/auth/client/add.d.ts.map +1 -1
  9. package/dist/commands/auth/client/add.js +173 -276
  10. package/dist/commands/auth/client/add.js.map +1 -1
  11. package/dist/commands/auth/client/delete.d.ts +1 -2
  12. package/dist/commands/auth/client/delete.d.ts.map +1 -1
  13. package/dist/commands/auth/client/delete.js +8 -18
  14. package/dist/commands/auth/client/delete.js.map +1 -1
  15. package/dist/commands/auth/client/list.d.ts.map +1 -1
  16. package/dist/commands/auth/client/list.js +11 -2
  17. package/dist/commands/auth/client/list.js.map +1 -1
  18. package/dist/commands/auth/client/shared.d.ts +72 -0
  19. package/dist/commands/auth/client/shared.d.ts.map +1 -0
  20. package/dist/commands/auth/client/shared.js +145 -0
  21. package/dist/commands/auth/client/shared.js.map +1 -0
  22. package/dist/commands/auth/client/update.d.ts +8 -0
  23. package/dist/commands/auth/client/update.d.ts.map +1 -0
  24. package/dist/commands/auth/client/update.js +515 -0
  25. package/dist/commands/auth/client/update.js.map +1 -0
  26. package/dist/index.d.ts +5 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +60 -13
  29. package/dist/index.js.map +1 -1
  30. package/dist/lib/oauth.d.ts +114 -7
  31. package/dist/lib/oauth.d.ts.map +1 -1
  32. package/dist/lib/oauth.js +51 -1
  33. package/dist/lib/oauth.js.map +1 -1
  34. package/package.json +4 -4
  35. package/src/commands/auth/client/add.ts +251 -330
  36. package/src/commands/auth/client/delete.ts +8 -20
  37. package/src/commands/auth/client/list.ts +21 -2
  38. package/src/commands/auth/client/shared.ts +195 -0
  39. package/src/commands/auth/client/update.ts +853 -0
  40. package/src/index.ts +74 -13
  41. package/src/lib/oauth.ts +83 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/auth/client/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,OAAO,EACP,aAAa,EACb,UAAU,EACV,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAS3C,MAAM,cAAc,GAAG,iBAAiB,CAAC;IACvC,OAAO,EAAE,iCAAiC;CAC3C,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,EAAE,OA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,CAAC,oBAAoB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,EACxE,KAAK,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAC5B,YAAY,CAAC,IAAI,CAAC;QAChB,OAAO,EAAE,YAAY,YAAY,kCAAkC;KACpE,CAAC,CACH,CACF,CAAC;AACJ,CAAC,EACD,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CACpC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CACf,KAAK,CAAC,GAAG,CACP,2EAA2E,CAC5E,CACF,CAAC;AACJ,CAAC,CAAC,CACH,CACF,CAAC","sourcesContent":["import { Effect, Match } from 'effect';\nimport type { authClientUpdateDef, OptsFromCommand } from '../../../index.ts';\nimport { BadArgsError } from '../../../errors.ts';\nimport { GlobalOpts } from '../../../context/globalOpts.ts';\nimport { optOrPrompt, runUIEffect } from '../../../lib/ui.ts';\nimport {\n findClientByIdOrName,\n getAppsAuth,\n OAuthClient,\n updateOAuthClient,\n} from '../../../lib/oauth.ts';\nimport { UI } from '../../../ui/index.ts';\nimport {\n clerkDomainFromPublishableKey,\n DEFAULT_OAUTH_CALLBACK_URL,\n} from '@instantdb/platform';\nimport chalk from 'chalk';\nimport boxen from 'boxen';\nimport {\n appleKeyIdPrompt,\n applePrivateKeyFilePrompt,\n appleServicesIdPrompt,\n appleTeamIdPrompt,\n clerkPublishableKeyPrompt,\n clientIdPrompt,\n clientSecretPrompt,\n firebaseDiscoveryEndpoint,\n firebaseProjectIdPrompt,\n getFlag,\n getMetaString,\n hasAnyFlag,\n hasFlag,\n isTrueFlag,\n readPrivateKeyFile,\n redirectSetupMessages,\n redirectUriPrompt,\n validateFirebaseProjectId,\n} from './shared.ts';\nimport { link } from '../../../logging.ts';\n\ntype OAuthClientRow = typeof OAuthClient.Type;\n\ntype ProviderRow = {\n id: string;\n provider_name: string;\n};\n\nconst redirectPrompt = redirectUriPrompt({\n heading: 'Custom redirect URI (optional):',\n});\nconst newRedirectPrompt = redirectUriPrompt({ heading: 'New redirect URI:' });\nconst googleConsoleUrl =\n 'https://console.developers.google.com/apis/credentials';\n\nconst resolveClient = Effect.fn(function* (params: {\n id?: string;\n name?: string;\n}) {\n const { yes } = yield* GlobalOpts;\n\n if (params.id || params.name) {\n return yield* findClientByIdOrName({\n id: params.id,\n name: params.name,\n });\n }\n\n if (yes) {\n return yield* BadArgsError.make({ message: 'Must specify --id or --name' });\n }\n\n const auth = yield* getAppsAuth();\n const clients = (auth.oauth_clients ?? []) as OAuthClientRow[];\n\n if (clients.length === 0) {\n return yield* BadArgsError.make({\n message: 'No OAuth clients found for this app.',\n });\n }\n\n return yield* runUIEffect(\n new UI.Select({\n options: clients.map((client) => ({\n label:\n client.client_name +\n (client.use_shared_credentials\n ? chalk.dim(' (dev credentials)')\n : '') +\n chalk.dim(` (${client.id})`),\n value: client,\n })),\n promptText: 'Select a client to update:',\n modifyOutput: UI.modifiers.dimOnComplete,\n }),\n ).pipe(\n Effect.catchTag('UIError', (e) =>\n BadArgsError.make({ message: `UI error: ${e.message}` }),\n ),\n Effect.map((client) => ({ auth, client })),\n );\n});\n\nconst selectUpdateAction = Effect.fn(function* <T extends string>(\n options: { label: string; value: T; secondary?: boolean }[],\n) {\n return yield* runUIEffect(\n new UI.Select({\n options,\n promptText: 'What do you want to update?',\n modifyOutput: UI.modifiers.dimOnComplete,\n }),\n ).pipe(\n Effect.catchTag('UIError', (e) =>\n BadArgsError.make({ message: `UI error: ${e.message}` }),\n ),\n );\n});\n\nconst updateGoogleToDevCredentials = Effect.fn(function* (\n client: OAuthClientRow,\n) {\n const response = yield* updateOAuthClient({\n oauthClientId: client.id,\n clientId: null,\n clientSecret: null,\n useSharedCredentials: true,\n redirectTo: null,\n });\n\n yield* Effect.log(\n boxen(\n [\n `Google OAuth client updated: ${response.client.client_name}`,\n 'Credentials: Instant dev credentials',\n `ID: ${response.client.id}`,\n '',\n 'No Google Console setup required.',\n 'Works on localhost and Expo during development.',\n '',\n chalk.bold('Ready for production? Run:'),\n ` instant-cli auth client update --name ${response.client.client_name} --client-id <id> --client-secret <secret>`,\n ].join('\\n'),\n { dimBorder: true, padding: { right: 1, left: 1 } },\n ),\n );\n});\n\ntype GoogleUpdateMode = 'dev' | 'custom' | 'redirect' | 'none';\n\nconst hasGoogleCustomCredentialFlags = (opts: Record<string, unknown>) =>\n hasAnyFlag(opts, ['client-id', 'client-secret', 'custom-redirect-uri']);\n\nconst hasGoogleUpdateFlags = (opts: Record<string, unknown>) =>\n isTrueFlag(getFlag(opts, 'dev-credentials')) ||\n hasGoogleCustomCredentialFlags(opts);\n\nconst optOrPromptWhenNeeded = (\n opts: Record<string, unknown>,\n flag: string,\n params: {\n promptIf: boolean;\n required?: boolean;\n prompt: UI.TextInputProps;\n },\n) =>\n Effect.gen(function* () {\n const value = getFlag(opts, flag);\n if (value === undefined && !params.promptIf) return undefined;\n return yield* optOrPrompt(value, {\n simpleName: `--${flag}`,\n required: params.required ?? params.promptIf,\n skipIf: false,\n prompt: params.prompt,\n });\n });\n\nconst selectGoogleUpdateMode = Effect.fn(function* ({\n isWeb,\n switchingFromShared,\n}: {\n isWeb: boolean;\n switchingFromShared: boolean;\n}) {\n if (switchingFromShared) {\n return yield* runUIEffect(\n new UI.Select({\n options: [\n { label: 'Custom Google credentials', value: 'custom' },\n {\n label: 'Instant dev credentials' + chalk.dim(' (current)'),\n value: 'none',\n },\n ],\n promptText: 'Choose credential mode:',\n modifyOutput: UI.modifiers.dimOnComplete,\n }),\n ).pipe(\n Effect.catchTag('UIError', (e) =>\n BadArgsError.make({ message: `UI error: ${e.message}` }),\n ),\n );\n }\n\n const options: { label: string; value: GoogleUpdateMode }[] = [\n { label: 'Update Client ID and Client Secret', value: 'custom' },\n ];\n\n if (isWeb) {\n options.push(\n {\n label:\n 'Switch to Instant dev credentials' +\n chalk.dim(' (localhost and Expo, no Google setup)'),\n value: 'dev',\n },\n { label: 'Update redirect URI', value: 'redirect' },\n );\n }\n\n return yield* selectUpdateAction(options);\n});\n\nconst resolveGoogleUpdateMode = Effect.fn(function* ({\n opts,\n isWeb,\n switchingFromShared,\n}: {\n opts: Record<string, unknown>;\n isWeb: boolean;\n switchingFromShared: boolean;\n}) {\n const { yes } = yield* GlobalOpts;\n const devCredentialsFlag = isTrueFlag(getFlag(opts, 'dev-credentials'));\n const hasProvidedSomeCustomCredentials = hasGoogleCustomCredentialFlags(opts);\n\n if (devCredentialsFlag && !isWeb) {\n return yield* BadArgsError.make({\n message: '--dev-credentials is only supported for Google web clients.',\n });\n }\n\n if (\n !isWeb &&\n (hasFlag(opts, 'client-secret') || hasFlag(opts, 'custom-redirect-uri'))\n ) {\n return yield* BadArgsError.make({\n message:\n '--client-secret and --custom-redirect-uri are only supported for Google web clients.',\n });\n }\n\n if (devCredentialsFlag && hasProvidedSomeCustomCredentials) {\n return yield* BadArgsError.make({\n message:\n '--dev-credentials cannot be combined with --client-id, --client-secret, or --custom-redirect-uri.',\n });\n }\n\n if (devCredentialsFlag) {\n return 'dev';\n }\n\n const hasAnyUpdateFlag = hasGoogleUpdateFlags(opts);\n\n if (yes && !hasAnyUpdateFlag) {\n return yield* BadArgsError.make({\n message:\n 'Must specify at least one of --client-id, --client-secret, --custom-redirect-uri, or --dev-credentials.',\n });\n }\n\n if (\n yes &&\n isWeb &&\n switchingFromShared &&\n (!hasFlag(opts, 'client-id') || !hasFlag(opts, 'client-secret'))\n ) {\n return yield* BadArgsError.make({\n message:\n 'Must specify both --client-id and --client-secret when switching from Instant dev credentials to custom credentials with --yes.',\n });\n }\n\n if (hasAnyUpdateFlag) {\n return 'custom';\n }\n\n return yield* selectGoogleUpdateMode({ isWeb, switchingFromShared });\n});\n\nconst updateGoogleRedirect = Effect.fn(function* ({\n opts,\n client,\n}: {\n opts: Record<string, unknown>;\n client: OAuthClientRow;\n}) {\n const redirectTo = yield* optOrPromptWhenNeeded(opts, 'custom-redirect-uri', {\n promptIf: true,\n required: true,\n prompt: newRedirectPrompt,\n });\n if (!redirectTo) {\n return yield* BadArgsError.make({\n message: 'Missing required value for --custom-redirect-uri',\n });\n }\n const response = yield* updateOAuthClient({\n oauthClientId: client.id,\n redirectTo,\n });\n yield* Effect.log(\n boxen(\n [\n `Google OAuth client updated: ${response.client.client_name}`,\n `ID: ${response.client.id}`,\n ...redirectSetupMessages({\n prompt: 'Add this redirect URI in Google Console',\n redirectUri: redirectTo,\n showCustomRedirectInstructions: true,\n }),\n ].join('\\n'),\n { dimBorder: true, padding: { right: 1, left: 1 } },\n ),\n );\n});\n\nconst updateGoogleCustomCredentials = Effect.fn(function* ({\n opts,\n client,\n isWeb,\n switchingFromShared,\n promptCredentials,\n}: {\n opts: Record<string, unknown>;\n client: OAuthClientRow;\n isWeb: boolean;\n switchingFromShared: boolean;\n promptCredentials: boolean;\n}) {\n const mustCollectCredentials = promptCredentials || switchingFromShared;\n const shouldPromptClientId =\n promptCredentials || (switchingFromShared && !hasFlag(opts, 'client-id'));\n const shouldPromptClientSecret =\n isWeb &&\n (promptCredentials ||\n (switchingFromShared && !hasFlag(opts, 'client-secret')));\n const shouldPromptRedirectUri =\n isWeb && switchingFromShared && promptCredentials;\n\n const clientId = yield* optOrPromptWhenNeeded(opts, 'client-id', {\n promptIf: shouldPromptClientId,\n required: mustCollectCredentials,\n prompt: clientIdPrompt({ providerUrl: googleConsoleUrl }),\n });\n const clientSecret = yield* optOrPromptWhenNeeded(opts, 'client-secret', {\n promptIf: shouldPromptClientSecret,\n required: isWeb && mustCollectCredentials,\n prompt: clientSecretPrompt({ providerUrl: googleConsoleUrl }),\n });\n const customRedirectUri = isWeb\n ? yield* optOrPromptWhenNeeded(opts, 'custom-redirect-uri', {\n promptIf: shouldPromptRedirectUri,\n required: false,\n prompt: redirectPrompt,\n })\n : undefined;\n\n const redirectTo = switchingFromShared\n ? customRedirectUri || client.redirect_to || DEFAULT_OAUTH_CALLBACK_URL\n : customRedirectUri;\n\n const response = yield* updateOAuthClient({\n oauthClientId: client.id,\n clientId,\n clientSecret,\n redirectTo,\n useSharedCredentials: switchingFromShared ? false : undefined,\n });\n\n const lines = [\n `Google OAuth client updated: ${response.client.client_name}`,\n 'Credentials: custom',\n `ID: ${response.client.id}`,\n ];\n\n if (switchingFromShared) {\n lines.push('', 'This client no longer uses Instant dev credentials.');\n }\n if (isWeb && redirectTo) {\n lines.push(\n ...redirectSetupMessages({\n prompt: 'Add this redirect URI in Google Console',\n redirectUri: redirectTo,\n showCustomRedirectInstructions: Boolean(customRedirectUri),\n }),\n );\n }\n\n yield* Effect.log(\n boxen(lines.join('\\n'), {\n dimBorder: true,\n padding: { right: 1, left: 1 },\n }),\n );\n});\n\nconst handleGoogleUpdate = Effect.fn(function* (\n opts: Record<string, unknown>,\n client: OAuthClientRow,\n) {\n const { yes } = yield* GlobalOpts;\n const appType = getMetaString(client.meta, 'appType');\n const isWeb = appType === 'web' || !appType;\n const switchingFromShared = Boolean(client.use_shared_credentials);\n const hasAnyUpdateFlag = hasGoogleUpdateFlags(opts);\n\n if (!hasAnyUpdateFlag && !yes) {\n yield* Effect.log(\n `\\nCurrent mode: ${\n switchingFromShared\n ? chalk.bold('Instant dev credentials')\n : 'custom credentials'\n }`,\n );\n }\n\n const updateMode = yield* resolveGoogleUpdateMode({\n opts,\n isWeb,\n switchingFromShared,\n });\n\n if (updateMode === 'dev') {\n return yield* updateGoogleToDevCredentials(client);\n }\n\n if (updateMode === 'none') {\n yield* Effect.log(chalk.dim('No changes made.'));\n return;\n }\n\n if (updateMode === 'redirect') {\n return yield* updateGoogleRedirect({ opts, client });\n }\n\n return yield* updateGoogleCustomCredentials({\n opts,\n client,\n isWeb,\n switchingFromShared,\n promptCredentials: !hasAnyUpdateFlag && !yes,\n });\n});\n\nconst handleClientIdSecretUpdate = Effect.fn(function* (params: {\n opts: Record<string, unknown>;\n client: OAuthClientRow;\n providerLabel: string;\n providerUrl: string;\n redirectSetupPrompt: string;\n}) {\n const { yes } = yield* GlobalOpts;\n const hasAnyUpdateFlag = hasAnyFlag(params.opts, [\n 'client-id',\n 'client-secret',\n 'custom-redirect-uri',\n ]);\n if (yes && !hasAnyUpdateFlag) {\n return yield* BadArgsError.make({\n message:\n 'Must specify at least one of --client-id, --client-secret, or --custom-redirect-uri.',\n });\n }\n\n let promptCredentials = false;\n let promptRedirect = false;\n\n if (!hasAnyUpdateFlag && !yes) {\n const action = yield* selectUpdateAction([\n { label: 'Update Client ID and Client Secret', value: 'rotate' },\n { label: 'Update redirect URI', value: 'redirect' },\n ]);\n promptCredentials = action === 'rotate';\n promptRedirect = action === 'redirect';\n }\n\n const clientId = yield* optOrPromptWhenNeeded(params.opts, 'client-id', {\n promptIf: promptCredentials,\n required: promptCredentials,\n prompt: clientIdPrompt({ providerUrl: params.providerUrl }),\n });\n const clientSecret = yield* optOrPromptWhenNeeded(\n params.opts,\n 'client-secret',\n {\n promptIf: promptCredentials,\n required: promptCredentials,\n prompt: clientSecretPrompt({ providerUrl: params.providerUrl }),\n },\n );\n const customRedirectUri = yield* optOrPromptWhenNeeded(\n params.opts,\n 'custom-redirect-uri',\n {\n promptIf: promptRedirect,\n required: promptRedirect,\n prompt: promptRedirect ? newRedirectPrompt : redirectPrompt,\n },\n );\n\n const response = yield* updateOAuthClient({\n oauthClientId: params.client.id,\n clientId,\n clientSecret,\n redirectTo: customRedirectUri,\n });\n\n const lines = [\n `${params.providerLabel} OAuth client updated: ${response.client.client_name}`,\n `ID: ${response.client.id}`,\n ];\n\n if (customRedirectUri) {\n lines.push(\n ...redirectSetupMessages({\n prompt: params.redirectSetupPrompt,\n redirectUri: customRedirectUri,\n showCustomRedirectInstructions: true,\n }),\n );\n }\n\n yield* Effect.log(\n boxen(lines.join('\\n'), {\n dimBorder: true,\n padding: { right: 1, left: 1 },\n }),\n );\n});\n\nconst appleWebFlags = [\n 'team-id',\n 'key-id',\n 'private-key-file',\n 'custom-redirect-uri',\n];\nconst appleUpdateFlags = ['services-id', ...appleWebFlags];\n\nconst hasAppleWebFlags = (opts: Record<string, unknown>) =>\n hasAnyFlag(opts, appleWebFlags);\n\nconst hasAppleUpdateFlags = (opts: Record<string, unknown>) =>\n hasAnyFlag(opts, appleUpdateFlags);\n\nconst appleClientHasWebConfig = (client: OAuthClientRow) =>\n Boolean(\n getMetaString(client.meta, 'teamId') ||\n getMetaString(client.meta, 'keyId') ||\n client.redirect_to,\n );\n\ntype AppleWebUpdate = {\n privateKey?: string;\n redirectTo?: string;\n customRedirectUri?: string;\n meta?: Record<string, string>;\n};\n\nconst resolveAppleUpdateConfig = Effect.fn(function* ({\n opts,\n client,\n yes,\n}: {\n opts: Record<string, unknown>;\n client: OAuthClientRow;\n yes: boolean;\n}) {\n const hasAnyUpdateFlag = hasAppleUpdateFlags(opts);\n\n if (yes && !hasAnyUpdateFlag) {\n return yield* BadArgsError.make({\n message:\n 'Must specify at least one of --services-id, --team-id, --key-id, --private-key-file, or --custom-redirect-uri.',\n });\n }\n\n const promptAll = !hasAnyUpdateFlag && !yes;\n if (!promptAll) {\n return { promptAll, configureWeb: hasAppleWebFlags(opts) };\n }\n\n const configureWeb = yield* runUIEffect(\n new UI.Confirmation({\n promptText:\n 'Configure web redirect flow? ' +\n chalk.dim(\n '(requires Team ID, Key ID, and a .p8 private key from Apple)',\n ),\n defaultValue: appleClientHasWebConfig(client),\n }),\n ).pipe(\n Effect.catchTag('UIError', (e) =>\n BadArgsError.make({ message: `UI error: ${e.message}` }),\n ),\n );\n\n return { promptAll, configureWeb };\n});\n\nconst readAppleWebUpdate = Effect.fn(function* ({\n opts,\n client,\n promptAll,\n}: {\n opts: Record<string, unknown>;\n client: OAuthClientRow;\n promptAll: boolean;\n}) {\n const teamId = yield* optOrPromptWhenNeeded(opts, 'team-id', {\n promptIf: promptAll,\n required: promptAll,\n prompt: appleTeamIdPrompt({}),\n });\n const keyId = yield* optOrPromptWhenNeeded(opts, 'key-id', {\n promptIf: promptAll,\n required: promptAll,\n prompt: appleKeyIdPrompt({}),\n });\n const privateKeyPath = yield* optOrPromptWhenNeeded(\n opts,\n 'private-key-file',\n {\n promptIf: promptAll,\n required: promptAll,\n prompt: applePrivateKeyFilePrompt({}),\n },\n );\n const privateKey = privateKeyPath\n ? yield* readPrivateKeyFile(privateKeyPath)\n : undefined;\n const customRedirectUri = yield* optOrPromptWhenNeeded(\n opts,\n 'custom-redirect-uri',\n {\n promptIf: promptAll,\n required: false,\n prompt: redirectPrompt,\n },\n );\n\n const meta: Record<string, string> = {};\n if (teamId) meta.teamId = teamId;\n if (keyId) meta.keyId = keyId;\n\n return {\n privateKey,\n redirectTo: privateKey\n ? customRedirectUri || client.redirect_to || DEFAULT_OAUTH_CALLBACK_URL\n : customRedirectUri,\n customRedirectUri,\n meta: Object.keys(meta).length ? meta : undefined,\n } satisfies AppleWebUpdate;\n});\n\nconst handleAppleUpdate = Effect.fn(function* (\n opts: Record<string, unknown>,\n client: OAuthClientRow,\n) {\n const { yes } = yield* GlobalOpts;\n const { promptAll, configureWeb } = yield* resolveAppleUpdateConfig({\n opts,\n client,\n yes,\n });\n\n const servicesId = yield* optOrPromptWhenNeeded(opts, 'services-id', {\n promptIf: promptAll,\n required: promptAll,\n prompt: appleServicesIdPrompt({}),\n });\n const webUpdate: AppleWebUpdate = configureWeb\n ? yield* readAppleWebUpdate({ opts, client, promptAll })\n : {};\n\n const response = yield* updateOAuthClient({\n oauthClientId: client.id,\n clientId: servicesId,\n clientSecret: webUpdate.privateKey,\n redirectTo: webUpdate.redirectTo,\n meta: webUpdate.meta,\n });\n\n const lines = [\n `Apple OAuth client updated: ${response.client.client_name}`,\n `ID: ${response.client.id}`,\n ];\n\n if (webUpdate.redirectTo) {\n lines.push(\n ...redirectSetupMessages({\n prompt: `Add this return URL under your Services ID on ${link('https://developer.apple.com', 'developer.apple.com')}`,\n redirectUri: webUpdate.redirectTo,\n showCustomRedirectInstructions: Boolean(webUpdate.customRedirectUri),\n }),\n );\n }\n\n yield* Effect.log(\n boxen(lines.join('\\n'), {\n dimBorder: true,\n padding: { right: 1, left: 1 },\n }),\n );\n});\n\nconst handleClerkUpdate = Effect.fn(function* (\n opts: Record<string, unknown>,\n client: OAuthClientRow,\n) {\n const { yes } = yield* GlobalOpts;\n const publishableKey = yield* optOrPromptWhenNeeded(opts, 'publishable-key', {\n promptIf: !yes && !hasFlag(opts, 'publishable-key'),\n required: true,\n prompt: clerkPublishableKeyPrompt({}),\n });\n\n if (!publishableKey) {\n return yield* BadArgsError.make({\n message: 'Missing required value for --publishable-key',\n });\n }\n\n const domain = clerkDomainFromPublishableKey(publishableKey);\n if (!domain) {\n return yield* BadArgsError.make({\n message: 'Invalid publishable key. Could not extract domain.',\n });\n }\n\n const response = yield* updateOAuthClient({\n oauthClientId: client.id,\n discoveryEndpoint: `https://${domain}/.well-known/openid-configuration`,\n meta: { clerkPublishableKey: publishableKey },\n });\n\n yield* Effect.log(\n boxen(\n [\n `Clerk OAuth client updated: ${response.client.client_name}`,\n `ID: ${response.client.id}`,\n `Clerk Domain: https://${domain}`,\n ].join('\\n'),\n { dimBorder: true, padding: { right: 1, left: 1 } },\n ),\n );\n});\n\nconst handleFirebaseUpdate = Effect.fn(function* (\n opts: Record<string, unknown>,\n client: OAuthClientRow,\n) {\n const { yes } = yield* GlobalOpts;\n const projectId = yield* optOrPromptWhenNeeded(opts, 'project-id', {\n promptIf: !yes && !hasFlag(opts, 'project-id'),\n required: true,\n prompt: firebaseProjectIdPrompt({}),\n });\n\n const validationError = validateFirebaseProjectId(projectId ?? '');\n if (validationError) {\n return yield* BadArgsError.make({ message: validationError });\n }\n\n const response = yield* updateOAuthClient({\n oauthClientId: client.id,\n discoveryEndpoint: firebaseDiscoveryEndpoint(projectId!),\n });\n\n yield* Effect.log(\n boxen(\n [\n `Firebase OAuth client updated: ${response.client.client_name}`,\n `ID: ${response.client.id}`,\n `Firebase Project ID: ${projectId}`,\n ].join('\\n'),\n { dimBorder: true, padding: { right: 1, left: 1 } },\n ),\n );\n});\n\nexport const authClientUpdateCmd = Effect.fn(\n function* (\n opts: OptsFromCommand<typeof authClientUpdateDef> & Record<string, unknown>,\n ) {\n const { auth, client: resolvedClient } = yield* resolveClient({\n id: opts.id,\n name: opts.name,\n });\n const provider = (auth.oauth_service_providers ?? []).find(\n (entry: ProviderRow) => entry.id === resolvedClient.provider_id,\n );\n\n if (!provider) {\n return yield* BadArgsError.make({\n message: `OAuth provider not found for client: ${resolvedClient.client_name}`,\n });\n }\n\n yield* Match.value(provider.provider_name).pipe(\n Match.withReturnType<Effect.Effect<void, any, any>>(),\n Match.when('google', () => handleGoogleUpdate(opts, resolvedClient)),\n Match.when('github', () =>\n handleClientIdSecretUpdate({\n opts,\n client: resolvedClient,\n providerLabel: 'GitHub',\n providerUrl: 'https://github.com/settings/developers',\n redirectSetupPrompt:\n 'Add this callback URL in your GitHub OAuth App settings',\n }),\n ),\n Match.when('linkedin', () =>\n handleClientIdSecretUpdate({\n opts,\n client: resolvedClient,\n providerLabel: 'LinkedIn',\n providerUrl: 'https://www.linkedin.com/developers/apps',\n redirectSetupPrompt:\n 'Add this redirect URI in your LinkedIn app settings',\n }),\n ),\n Match.when('apple', () => handleAppleUpdate(opts, resolvedClient)),\n Match.when('clerk', () => handleClerkUpdate(opts, resolvedClient)),\n Match.when('firebase', () => handleFirebaseUpdate(opts, resolvedClient)),\n Match.orElse((providerName) =>\n BadArgsError.make({\n message: `Updating ${providerName} OAuth clients is not supported.`,\n }),\n ),\n );\n },\n Effect.catchTag('BadArgsError', (e) =>\n Effect.gen(function* () {\n yield* Effect.logError(e.message);\n yield* Effect.log(\n chalk.dim(\n 'hint: run `instant-cli auth client update --help` for available arguments',\n ),\n );\n }),\n ),\n);\n"]}
package/dist/index.d.ts CHANGED
@@ -20,6 +20,11 @@ export declare const authClientDeleteDef: Command<[], {
20
20
  name?: string | undefined;
21
21
  app?: string | undefined;
22
22
  }, {}>;
23
+ export declare const authClientUpdateDef: Command<[], {
24
+ id?: string | undefined;
25
+ name?: string | undefined;
26
+ app?: string | undefined;
27
+ }, {}>;
23
28
  export declare const authOriginListDef: Command<[], {
24
29
  app?: string | undefined;
25
30
  json?: true | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AA+B9D,MAAM,MAAM,eAAe,CAAC,CAAC,IAC3B,CAAC,SAAS,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAiBnD,eAAO,MAAM,OAAO;;;;;MAgChB,CAAC;AAIL,eAAO,MAAM,gBAAgB;;;;MA8DzB,CAAC;AACL,eAAO,MAAM,iBAAiB;;;MAsB1B,CAAC;AAEL,eAAO,MAAM,mBAAmB;;;;MAoB5B,CAAC;AAGL,eAAO,MAAM,iBAAiB;;;MAoB1B,CAAC;AAEL,eAAO,MAAM,gBAAgB;;;;;;;MA2CzB,CAAC;AAEL,eAAO,MAAM,mBAAmB;;;MAmB5B,CAAC;AAEL,eAAO,MAAM,mBAAmB;;;;MAgB5B,CAAC;AAEL,eAAO,MAAM,QAAQ;;;MAYjB,CAAC;AAWL,eAAO,MAAM,OAAO,qBAchB,CAAC;AAEL,eAAO,MAAM,WAAW;;MAmBpB,CAAC;AAEL,eAAO,MAAM,QAAQ;;;;;;MAiBjB,CAAC;AAEL,eAAO,MAAM,OAAO;;;;MA4ChB,CAAC;AAEL,eAAO,MAAM,OAAO;;;;;MAgDhB,CAAC;AAEL,eAAO,MAAM,QAAQ;;MAoBjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAgC9D,MAAM,MAAM,eAAe,CAAC,CAAC,IAC3B,CAAC,SAAS,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAiBnD,eAAO,MAAM,OAAO;;;;;MAgChB,CAAC;AAIL,eAAO,MAAM,gBAAgB;;;;MA+DzB,CAAC;AACL,eAAO,MAAM,iBAAiB;;;MAsB1B,CAAC;AAEL,eAAO,MAAM,mBAAmB;;;;MAoB5B,CAAC;AAEL,eAAO,MAAM,mBAAmB;;;;MAyD5B,CAAC;AAGL,eAAO,MAAM,iBAAiB;;;MAoB1B,CAAC;AAEL,eAAO,MAAM,gBAAgB;;;;;;;MA2CzB,CAAC;AAEL,eAAO,MAAM,mBAAmB;;;MAmB5B,CAAC;AAEL,eAAO,MAAM,mBAAmB;;;;MAgB5B,CAAC;AAEL,eAAO,MAAM,QAAQ;;;MAYjB,CAAC;AAWL,eAAO,MAAM,OAAO,qBAchB,CAAC;AAEL,eAAO,MAAM,WAAW;;MAmBpB,CAAC;AAEL,eAAO,MAAM,QAAQ;;;;;;MAiBjB,CAAC;AAEL,eAAO,MAAM,OAAO;;;;MA4ChB,CAAC;AAEL,eAAO,MAAM,OAAO;;;;;MAgDhB,CAAC;AAEL,eAAO,MAAM,QAAQ;;MAoBjB,CAAC"}
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ import { PACKAGE_ALIAS_AND_FULL_NAMES } from "./context/projectInfo.js";
21
21
  import { authClientAddCmd } from "./commands/auth/client/add.js";
22
22
  import { authClientListCmd } from "./commands/auth/client/list.js";
23
23
  import { authClientDeleteCmd } from "./commands/auth/client/delete.js";
24
+ import { authClientUpdateCmd } from "./commands/auth/client/update.js";
24
25
  import { authOriginListCmd } from "./commands/auth/origin/list.js";
25
26
  import { authOriginDeleteCmd } from "./commands/auth/origin/delete.js";
26
27
  import { authOriginAddCmd } from "./commands/auth/origin/add.js";
@@ -67,28 +68,29 @@ export const authClientAddDef = authClient
67
68
  .addHelpText('after', `
68
69
  Provider Specific Options:
69
70
  Google:
70
- --app-type web|ios|android|button-for-web
71
- --client-id
72
- --client-secret (web only)
73
- --custom-redirect-uri (optional, web only)
71
+ --app-type web|ios|android|button-for-web
72
+ --dev-credentials (optional, web only)
73
+ --client-id (required unless using dev credentials)
74
+ --client-secret (web only, unless using dev credentials)
75
+ --custom-redirect-uri (optional, web only)
74
76
  GitHub:
75
77
  --client-id
76
78
  --client-secret
77
- --custom-redirect-uri (optional)
79
+ --custom-redirect-uri (optional)
78
80
  Apple:
79
- --services-id (Services ID from ${link('https://developer.apple.com', 'developer.apple.com')})
80
- --team-id (optional, required for web redirect flow)
81
- --key-id (optional, required for web redirect flow)
82
- --private-key-file (optional, path to .p8 PEM; required for web redirect flow)
83
- --custom-redirect-uri (optional, web redirect flow only)
81
+ --services-id (Services ID from ${link('https://developer.apple.com', 'developer.apple.com')})
82
+ --team-id (optional, required for web redirect flow)
83
+ --key-id (optional, required for web redirect flow)
84
+ --private-key-file (optional, path to .p8 PEM; required for web redirect flow)
85
+ --custom-redirect-uri (optional, web redirect flow only)
84
86
  LinkedIn:
85
87
  --client-id
86
88
  --client-secret
87
- --custom-redirect-uri (optional)
89
+ --custom-redirect-uri (optional)
88
90
  Clerk:
89
- --publishable-key (Publishable Key from ${link('https://dashboard.clerk.com', 'dashboard.clerk.com')})
91
+ --publishable-key (Publishable Key from ${link('https://dashboard.clerk.com', 'dashboard.clerk.com')})
90
92
  Firebase:
91
- --project-id (Project ID from ${link('https://console.firebase.google.com', 'console.firebase.google.com')})
93
+ --project-id (Project ID from ${link('https://console.firebase.google.com', 'console.firebase.google.com')})
92
94
  `)
93
95
  .action((opts) => {
94
96
  opts = {
@@ -128,6 +130,51 @@ export const authClientDeleteDef = authClient
128
130
  allowAdminToken: true,
129
131
  }))));
130
132
  });
133
+ export const authClientUpdateDef = authClient
134
+ .command('update')
135
+ .description('Update an OAuth client')
136
+ .allowExcessArguments(true)
137
+ .allowUnknownOption(true)
138
+ .option('--id <client-id>', 'Client ID to update')
139
+ .option('--name <client-name>', 'Client name to update')
140
+ .option('-a --app <app-id>', 'App ID to update a client in. Defaults to *_INSTANT_APP_ID in .env')
141
+ .addHelpText('after', `
142
+ Provider Specific Options:
143
+ Google:
144
+ --dev-credentials (web only)
145
+ --client-id
146
+ --client-secret (web only)
147
+ --custom-redirect-uri (optional, web only)
148
+ GitHub:
149
+ --client-id
150
+ --client-secret
151
+ --custom-redirect-uri (optional)
152
+ Apple:
153
+ --services-id
154
+ --team-id (web redirect flow)
155
+ --key-id (web redirect flow)
156
+ --private-key-file (web redirect flow)
157
+ --custom-redirect-uri (optional, web redirect flow only)
158
+ LinkedIn:
159
+ --client-id
160
+ --client-secret
161
+ --custom-redirect-uri (optional)
162
+ Clerk:
163
+ --publishable-key
164
+ Firebase:
165
+ --project-id
166
+ `)
167
+ .action((opts) => {
168
+ opts = {
169
+ ...opts,
170
+ ...minimist(process.argv),
171
+ };
172
+ return runCommandEffect(authClientUpdateCmd(opts).pipe(Effect.provide(WithAppLayer({
173
+ coerce: false,
174
+ appId: opts.app,
175
+ allowAdminToken: true,
176
+ }))));
177
+ });
131
178
  const authOrigin = auth.command('origin');
132
179
  export const authOriginListDef = authOrigin
133
180
  .command('list')
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,CAAC;AAEV,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,E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AC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { loadEnv } from './util/loadEnv.ts';\n\nloadEnv();\n\nimport minimist from 'minimist';\nimport { Command, Option } from '@commander-js/extra-typings';\nimport chalk from 'chalk';\nimport { Effect, Layer } from 'effect';\nimport version from './version.js';\nimport { initCommand } from './commands/init.ts';\nimport { initWithoutFilesCommand } from './commands/initWithoutFiles.ts';\nimport { loginCommand } from './commands/login.ts';\nimport { logoutCommand } from './commands/logout.ts';\nimport {\n AuthLayerLive,\n BaseLayerLive,\n runCommandEffect,\n WithAppLayer,\n} from './layer.ts';\nimport { infoCommand } from './commands/info.ts';\nimport { pullCommand } from './commands/pull.ts';\nimport type { SchemaPermsOrBoth } from './commands/pull.ts';\nimport { claimCommand } from './commands/claim.ts';\nimport { pushCommand } from './commands/push.ts';\nimport { explorerCmd } from './commands/explorer.ts';\nimport { queryCmd } from './commands/query.ts';\nimport { program } from './program.ts';\nimport { PACKAGE_ALIAS_AND_FULL_NAMES } from './context/projectInfo.ts';\nimport { authClientAddCmd } from './commands/auth/client/add.ts';\nimport { authClientListCmd } from './commands/auth/client/list.ts';\nimport { authClientDeleteCmd } from './commands/auth/client/delete.ts';\nimport { authOriginListCmd } from './commands/auth/origin/list.ts';\nimport { authOriginDeleteCmd } from './commands/auth/origin/delete.ts';\nimport { authOriginAddCmd } from './commands/auth/origin/add.ts';\nimport { link } from './logging.ts';\n\nexport type OptsFromCommand<C> =\n C extends Command<any, infer R, any> ? R : never;\n\nprogram\n .name('instant-cli')\n .addOption(globalOption('-t --token <token>', 'Auth token override'))\n .addOption(globalOption('-y --yes', \"Answer 'yes' to all prompts\"))\n .addOption(globalOption('--env <file>', 'Use a specific .env file'))\n .addOption(\n globalOption('-v --version', 'Print the version number', () => {\n console.log(version);\n process.exit(0);\n }),\n )\n .addHelpOption(globalOption('-h --help', 'Print the help text for a command'))\n .usage(`<command> ${chalk.dim('[options] [args]')}`);\n\n// Command List\nexport const initDef = program\n .command('init')\n .description('Set up a new project.')\n .option(\n '-a --app <app-id>',\n 'If you have an existing app ID, we can pull schema and perms from there.',\n )\n .option(\n '-p --package <react|react-native|core|admin|solid|svelte>',\n 'Which package to automatically install if there is not one installed already.',\n )\n .option('--title <title>', 'Title for the created app')\n .option(\n '--temp',\n 'Create a temporary app which will automatically delete itself after >24 hours.',\n )\n .action((options) => {\n return runCommandEffect(\n initCommand(options).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: true,\n coerceAuth: true,\n title: options.title,\n appId: options.app,\n packageName: options.package as any,\n applyEnv: true,\n temp: options.temp,\n }),\n ),\n ),\n );\n });\n\nconst auth = program.command('auth');\nconst authClient = auth.command('client');\nexport const authClientAddDef = authClient\n .command('add')\n .allowExcessArguments(true)\n .allowUnknownOption(true)\n .option(\n '--type <google|github|apple|linkedin>',\n 'Type of oauth client to add',\n )\n .option(\n '--name <client name>',\n 'Custom name to identify the OAuth client (ex: google-web)',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to modify. Defaults to *_INSTANT_APP_ID in .env',\n )\n .addHelpText(\n 'after',\n `\nProvider Specific Options:\n Google:\n --app-type web|ios|android|button-for-web\n --client-id\n --client-secret (web only)\n --custom-redirect-uri (optional, web only)\n GitHub:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Apple:\n --services-id (Services ID from ${link('https://developer.apple.com', 'developer.apple.com')})\n --team-id (optional, required for web redirect flow)\n --key-id (optional, required for web redirect flow)\n --private-key-file (optional, path to .p8 PEM; required for web redirect flow)\n --custom-redirect-uri (optional, web redirect flow only)\n LinkedIn:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Clerk:\n --publishable-key (Publishable Key from ${link('https://dashboard.clerk.com', 'dashboard.clerk.com')})\n Firebase:\n --project-id (Project ID from ${link('https://console.firebase.google.com', 'console.firebase.google.com')})\n`,\n )\n .action((opts) => {\n opts = {\n ...opts,\n ...minimist(process.argv),\n };\n return runCommandEffect(\n authClientAddCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\nexport const authClientListDef = authClient\n .command('list')\n .option(\n '-a --app <app-id>',\n 'App ID to list clients for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--json', 'Enable JSON output')\n .allowUnknownOption(true)\n .action((opts) => {\n return runCommandEffect(\n authClientListCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n // Silence \"searching for instant sdk.. logs for json output\"\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const authClientDeleteDef = authClient\n .command('delete')\n .option('--id <client-id>', 'Client ID to delete')\n .option('--name <client-name>', 'Client name to delete')\n .option(\n '-a --app <app-id>',\n 'App ID to delete a client from. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n authClientDeleteCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nconst authOrigin = auth.command('origin');\nexport const authOriginListDef = authOrigin\n .command('list')\n .option(\n '-a --app <app-id>',\n 'App ID to list origins for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--json', 'Enable JSON output')\n .action((opts) => {\n return runCommandEffect(\n authOriginListCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const authOriginAddDef = authOrigin\n .command('add')\n .option(\n '--type <website|vercel|netlify|custom-scheme>',\n 'Type of origin to add.',\n )\n .option('--url <url>', 'Website URL (for website type, e.g. example.com)')\n .option(\n '--project <name>',\n 'Vercel project name (for vercel type, e.g. my-project)',\n )\n .option('--site <name>', 'Netlify site name (for netlify type, e.g. my-site)')\n .option(\n '--scheme <scheme>',\n 'App scheme (for custom-scheme type, e.g. myapp://)',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to add an origin to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .addHelpText(\n 'after',\n `\nOrigin Types:\n website A standard website origin (e.g. example.com)\n vercel Vercel preview deployments (project name)\n netlify Netlify preview deployments (site name)\n custom-scheme Native app scheme (e.g. your-app-scheme://)\n`,\n )\n .action((opts) => {\n return runCommandEffect(\n authOriginAddCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const authOriginDeleteDef = authOrigin\n .command('delete')\n .option('--id <origin-id>', 'Origin ID to delete')\n .option(\n '-a --app <app-id>',\n 'App ID to delete an origin from. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n authOriginDeleteCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const initWithoutFilesDef = program\n .command('init-without-files')\n .description('Generate a new app id and admin token pair without any files.')\n .option('--title <title>', 'Title for the created app.')\n .option(\n '--org-id <org-id>',\n 'Organization id for app. Cannot be used with --temp flag.',\n )\n .option(\n '--temp',\n 'Create a temporary app which will automatically delete itself after >24 hours.',\n )\n .action((opts) => {\n return runCommandEffect(\n initWithoutFilesCommand(opts).pipe(Effect.provide(BaseLayerLive)),\n );\n });\n\nexport const loginDef = program\n .command('login')\n .description('Log into your account')\n .option('-p --print', 'Prints the auth token into the console.')\n .option(\n '--headless',\n 'Print the login URL instead of trying to open the browser',\n )\n .action(async (opts) => {\n await runCommandEffect(\n loginCommand(opts).pipe(Effect.provide(BaseLayerLive)),\n );\n });\n\nprogram\n .command('logout')\n .description('Log out of your Instant account')\n .action(async () => {\n return runCommandEffect(\n logoutCommand().pipe(Effect.provide(BaseLayerLive)),\n );\n });\n\nexport const infoDef = program\n .command('info')\n .description('Display CLI version and login status')\n .action(async () => {\n return runCommandEffect(\n infoCommand().pipe(\n Effect.provide(\n AuthLayerLive({\n coerce: false,\n allowAdminToken: false,\n }).pipe(Layer.catchAll(() => Layer.empty)), // make the auth layer optional\n ),\n ),\n );\n });\n\nexport const explorerDef = program\n .command('explorer')\n .description('Opens the Explorer in your browser')\n .option(\n '-a --app <app-id>',\n 'App ID to open the explorer to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action(async (opts) => {\n return runCommandEffect(\n explorerCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: true,\n coerceAuth: true,\n appId: opts.app,\n }),\n ),\n ),\n );\n });\n\nexport const queryDef = program\n .command('query')\n .argument('<query>', 'InstaQL query as JSON/JSON5')\n .option(\n '-a --app <app-id>',\n 'App ID to query. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--admin', 'Run the query as admin (bypasses permissions)')\n .option('--as-email <email>', 'Run the query as a specific user by email')\n .option('--as-guest', 'Run the query as an unauthenticated guest')\n .option(\n '--as-token <refresh-token>',\n 'Run the query as a user identified by refresh token',\n )\n .description('Run an InstaQL query against your app.')\n .action(async function (queryArg, opts) {\n return runCommandEffect(queryCmd(queryArg, opts));\n });\n\nexport const pullDef = program\n .command('pull')\n .argument(\n '[schema|perms|all]',\n 'Which configuration to pull. Defaults to `all`',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to pull to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option(\n '-p --package <react|react-native|core|admin|solid|svelte>',\n 'Which package to automatically install if there is not one installed already.',\n )\n .option(\n '--experimental-type-preservation',\n \"[Experimental] Preserve manual type changes like `status: i.json<'online' | 'offline'>()` when doing `instant-cli pull schema`\",\n )\n .description('Pull schema and perm files from production.')\n .addHelpText(\n 'after',\n `\nEnvironment Variables:\n INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)\n INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)\n`,\n )\n .action(async function (arg, inputOpts) {\n return runCommandEffect(\n pullCommand(arg as SchemaPermsOrBoth, inputOpts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: true,\n packageName: inputOpts.package as\n | 'react'\n | 'react-native'\n | 'core'\n | 'admin'\n | undefined,\n appId: inputOpts.app,\n }),\n ),\n ),\n );\n });\n\nexport const pushDef = program\n .command('push')\n .argument(\n '[schema|perms|all]',\n 'Which configuration to push. Defaults to `all`',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to push to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option(\n '--skip-check-types',\n \"Don't check types on the server when pushing schema\",\n )\n .option(\n '--rename [renames...]',\n 'List of full attribute names separated by a \":\"\\n Example:`push --rename posts.author:posts.creator stores.owner:stores.manager`',\n )\n .option(\n '-p --package <react|react-native|core|admin|solid|svelte>',\n 'Which package to automatically install if there is not one installed already.',\n )\n .description('Push schema and perm files to production.')\n .addHelpText(\n 'after',\n `\nEnvironment Variables:\n INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)\n INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)\n`,\n )\n .action(async function (arg, inputOpts) {\n return runCommandEffect(\n pushCommand(arg, inputOpts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: inputOpts.app,\n coerceLibraryInstall: true,\n coerceAuth: false,\n allowAdminToken: true,\n applyEnv: true,\n packageName:\n inputOpts.package as keyof typeof PACKAGE_ALIAS_AND_FULL_NAMES,\n }),\n ),\n ),\n );\n });\n\nexport const claimDef = program\n .command('claim')\n .description('Transfer a temporary app into your Instant account')\n .option(\n '-a --app <app-id>',\n 'App to claim. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action(async function (opts) {\n return runCommandEffect(\n claimCommand.pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n allowAdminToken: false,\n appId: opts.app,\n applyEnv: false,\n }),\n ),\n ),\n );\n });\n//// Program setup /////\n\nfunction globalOption(\n flags: string,\n description?: string,\n argParser?: (value: string, prev?: unknown) => unknown,\n) {\n const opt = new Option(flags, description);\n if (argParser) {\n opt.argParser(argParser);\n }\n // @ts-ignore\n // __global does not exist on `Option`,\n // but we use it in `getLocalAndGlobalOptions`, to produce\n // our own custom list of local and global options.\n // For more info, see the original PR:\n // https://github.com/instantdb/instant/pull/505\n opt.__global = true;\n return opt;\n}\n\nfunction getLocalAndGlobalOptions(cmd: any, helper: any) {\n const mixOfLocalAndGlobal = helper.visibleOptions(cmd);\n const localOptionsFromMix = mixOfLocalAndGlobal.filter(\n (option: any) => !option.__global,\n );\n const globalOptionsFromMix = mixOfLocalAndGlobal.filter(\n (option: any) => option.__global,\n );\n const globalOptions = helper.visibleGlobalOptions(cmd);\n\n return [localOptionsFromMix, globalOptionsFromMix.concat(globalOptions)];\n}\n\nfunction formatHelp(\n this: { showGlobalOptions: boolean },\n cmd: any,\n helper: any,\n) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth || 80;\n const itemIndentWidth = 2;\n const itemSeparatorWidth = 2; // between term and description\n function formatItem(term: string, description: string | undefined) {\n if (description) {\n const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;\n return helper.boxWrap(\n fullText,\n helpWidth - itemIndentWidth,\n termWidth + itemSeparatorWidth,\n );\n }\n return term;\n }\n function formatList(textArray: string[]) {\n return textArray.join('\\n').replace(/^/gm, ' '.repeat(itemIndentWidth));\n }\n\n // Usage\n let output = [`${helper.commandUsage(cmd)}`, ''];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(commandDescription, helpWidth, 0),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument: any) => {\n return formatItem(\n helper.argumentTerm(argument),\n helper.argumentDescription(argument),\n );\n });\n if (argumentList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Arguments'),\n formatList(argumentList),\n '',\n ]);\n }\n const [visibleOptions, visibleGlobalOptions] = getLocalAndGlobalOptions(\n cmd,\n helper,\n );\n\n // Options\n const optionList = visibleOptions.map((option: any) => {\n return formatItem(\n helper.optionTerm(option),\n helper.optionDescription(option),\n );\n });\n if (optionList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Options'),\n formatList(optionList),\n '',\n ]);\n }\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd: any) => {\n return formatItem(\n helper.subcommandTerm(cmd),\n helper.subcommandDescription(cmd),\n );\n });\n if (commandList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Commands'),\n formatList(commandList),\n '',\n ]);\n }\n\n if (this.showGlobalOptions) {\n const globalOptionList = visibleGlobalOptions.map((option: any) => {\n return formatItem(\n helper.optionTerm(option),\n helper.optionDescription(option),\n );\n });\n if (globalOptionList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Global Options'),\n formatList(globalOptionList),\n '',\n ]);\n }\n }\n\n return output.join('\\n');\n}\n\nprogram.configureHelp({\n showGlobalOptions: true,\n formatHelp,\n});\n\nprogram.parse(process.argv);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,CAAC;AAEV,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,YAAY,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AC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;YAC1B,UAAU,CAAC,WAAW,CAAC;YACvB,EAAE;SACH,CAAC,CAAC;IACL,CAAC;IAED,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,MAAW,EAAE,EAAE;YAChE,OAAO,UAAU,CACf,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EACzB,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CACjC,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;gBACrB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC;gBAChC,UAAU,CAAC,gBAAgB,CAAC;gBAC5B,EAAE;aACH,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,OAAO,CAAC,aAAa,CAAC;IACpB,iBAAiB,EAAE,IAAI;IACvB,UAAU;CACX,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { loadEnv } from './util/loadEnv.ts';\n\nloadEnv();\n\nimport minimist from 'minimist';\nimport { Command, Option } from '@commander-js/extra-typings';\nimport chalk from 'chalk';\nimport { Effect, Layer } from 'effect';\nimport version from './version.js';\nimport { initCommand } from './commands/init.ts';\nimport { initWithoutFilesCommand } from './commands/initWithoutFiles.ts';\nimport { loginCommand } from './commands/login.ts';\nimport { logoutCommand } from './commands/logout.ts';\nimport {\n AuthLayerLive,\n BaseLayerLive,\n runCommandEffect,\n WithAppLayer,\n} from './layer.ts';\nimport { infoCommand } from './commands/info.ts';\nimport { pullCommand } from './commands/pull.ts';\nimport type { SchemaPermsOrBoth } from './commands/pull.ts';\nimport { claimCommand } from './commands/claim.ts';\nimport { pushCommand } from './commands/push.ts';\nimport { explorerCmd } from './commands/explorer.ts';\nimport { queryCmd } from './commands/query.ts';\nimport { program } from './program.ts';\nimport { PACKAGE_ALIAS_AND_FULL_NAMES } from './context/projectInfo.ts';\nimport { authClientAddCmd } from './commands/auth/client/add.ts';\nimport { authClientListCmd } from './commands/auth/client/list.ts';\nimport { authClientDeleteCmd } from './commands/auth/client/delete.ts';\nimport { authClientUpdateCmd } from './commands/auth/client/update.ts';\nimport { authOriginListCmd } from './commands/auth/origin/list.ts';\nimport { authOriginDeleteCmd } from './commands/auth/origin/delete.ts';\nimport { authOriginAddCmd } from './commands/auth/origin/add.ts';\nimport { link } from './logging.ts';\n\nexport type OptsFromCommand<C> =\n C extends Command<any, infer R, any> ? R : never;\n\nprogram\n .name('instant-cli')\n .addOption(globalOption('-t --token <token>', 'Auth token override'))\n .addOption(globalOption('-y --yes', \"Answer 'yes' to all prompts\"))\n .addOption(globalOption('--env <file>', 'Use a specific .env file'))\n .addOption(\n globalOption('-v --version', 'Print the version number', () => {\n console.log(version);\n process.exit(0);\n }),\n )\n .addHelpOption(globalOption('-h --help', 'Print the help text for a command'))\n .usage(`<command> ${chalk.dim('[options] [args]')}`);\n\n// Command List\nexport const initDef = program\n .command('init')\n .description('Set up a new project.')\n .option(\n '-a --app <app-id>',\n 'If you have an existing app ID, we can pull schema and perms from there.',\n )\n .option(\n '-p --package <react|react-native|core|admin|solid|svelte>',\n 'Which package to automatically install if there is not one installed already.',\n )\n .option('--title <title>', 'Title for the created app')\n .option(\n '--temp',\n 'Create a temporary app which will automatically delete itself after >24 hours.',\n )\n .action((options) => {\n return runCommandEffect(\n initCommand(options).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: true,\n coerceAuth: true,\n title: options.title,\n appId: options.app,\n packageName: options.package as any,\n applyEnv: true,\n temp: options.temp,\n }),\n ),\n ),\n );\n });\n\nconst auth = program.command('auth');\nconst authClient = auth.command('client');\nexport const authClientAddDef = authClient\n .command('add')\n .allowExcessArguments(true)\n .allowUnknownOption(true)\n .option(\n '--type <google|github|apple|linkedin>',\n 'Type of oauth client to add',\n )\n .option(\n '--name <client name>',\n 'Custom name to identify the OAuth client (ex: google-web)',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to modify. Defaults to *_INSTANT_APP_ID in .env',\n )\n .addHelpText(\n 'after',\n `\nProvider Specific Options:\n Google:\n --app-type web|ios|android|button-for-web\n --dev-credentials (optional, web only)\n --client-id (required unless using dev credentials)\n --client-secret (web only, unless using dev credentials)\n --custom-redirect-uri (optional, web only)\n GitHub:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Apple:\n --services-id (Services ID from ${link('https://developer.apple.com', 'developer.apple.com')})\n --team-id (optional, required for web redirect flow)\n --key-id (optional, required for web redirect flow)\n --private-key-file (optional, path to .p8 PEM; required for web redirect flow)\n --custom-redirect-uri (optional, web redirect flow only)\n LinkedIn:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Clerk:\n --publishable-key (Publishable Key from ${link('https://dashboard.clerk.com', 'dashboard.clerk.com')})\n Firebase:\n --project-id (Project ID from ${link('https://console.firebase.google.com', 'console.firebase.google.com')})\n`,\n )\n .action((opts) => {\n opts = {\n ...opts,\n ...minimist(process.argv),\n };\n return runCommandEffect(\n authClientAddCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\nexport const authClientListDef = authClient\n .command('list')\n .option(\n '-a --app <app-id>',\n 'App ID to list clients for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--json', 'Enable JSON output')\n .allowUnknownOption(true)\n .action((opts) => {\n return runCommandEffect(\n authClientListCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n // Silence \"searching for instant sdk.. logs for json output\"\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const authClientDeleteDef = authClient\n .command('delete')\n .option('--id <client-id>', 'Client ID to delete')\n .option('--name <client-name>', 'Client name to delete')\n .option(\n '-a --app <app-id>',\n 'App ID to delete a client from. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n authClientDeleteCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const authClientUpdateDef = authClient\n .command('update')\n .description('Update an OAuth client')\n .allowExcessArguments(true)\n .allowUnknownOption(true)\n .option('--id <client-id>', 'Client ID to update')\n .option('--name <client-name>', 'Client name to update')\n .option(\n '-a --app <app-id>',\n 'App ID to update a client in. Defaults to *_INSTANT_APP_ID in .env',\n )\n .addHelpText(\n 'after',\n `\nProvider Specific Options:\n Google:\n --dev-credentials (web only)\n --client-id\n --client-secret (web only)\n --custom-redirect-uri (optional, web only)\n GitHub:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Apple:\n --services-id\n --team-id (web redirect flow)\n --key-id (web redirect flow)\n --private-key-file (web redirect flow)\n --custom-redirect-uri (optional, web redirect flow only)\n LinkedIn:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Clerk:\n --publishable-key\n Firebase:\n --project-id\n`,\n )\n .action((opts) => {\n opts = {\n ...opts,\n ...minimist(process.argv),\n };\n\n return runCommandEffect(\n authClientUpdateCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nconst authOrigin = auth.command('origin');\nexport const authOriginListDef = authOrigin\n .command('list')\n .option(\n '-a --app <app-id>',\n 'App ID to list origins for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--json', 'Enable JSON output')\n .action((opts) => {\n return runCommandEffect(\n authOriginListCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const authOriginAddDef = authOrigin\n .command('add')\n .option(\n '--type <website|vercel|netlify|custom-scheme>',\n 'Type of origin to add.',\n )\n .option('--url <url>', 'Website URL (for website type, e.g. example.com)')\n .option(\n '--project <name>',\n 'Vercel project name (for vercel type, e.g. my-project)',\n )\n .option('--site <name>', 'Netlify site name (for netlify type, e.g. my-site)')\n .option(\n '--scheme <scheme>',\n 'App scheme (for custom-scheme type, e.g. myapp://)',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to add an origin to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .addHelpText(\n 'after',\n `\nOrigin Types:\n website A standard website origin (e.g. example.com)\n vercel Vercel preview deployments (project name)\n netlify Netlify preview deployments (site name)\n custom-scheme Native app scheme (e.g. your-app-scheme://)\n`,\n )\n .action((opts) => {\n return runCommandEffect(\n authOriginAddCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const authOriginDeleteDef = authOrigin\n .command('delete')\n .option('--id <origin-id>', 'Origin ID to delete')\n .option(\n '-a --app <app-id>',\n 'App ID to delete an origin from. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n authOriginDeleteCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const initWithoutFilesDef = program\n .command('init-without-files')\n .description('Generate a new app id and admin token pair without any files.')\n .option('--title <title>', 'Title for the created app.')\n .option(\n '--org-id <org-id>',\n 'Organization id for app. Cannot be used with --temp flag.',\n )\n .option(\n '--temp',\n 'Create a temporary app which will automatically delete itself after >24 hours.',\n )\n .action((opts) => {\n return runCommandEffect(\n initWithoutFilesCommand(opts).pipe(Effect.provide(BaseLayerLive)),\n );\n });\n\nexport const loginDef = program\n .command('login')\n .description('Log into your account')\n .option('-p --print', 'Prints the auth token into the console.')\n .option(\n '--headless',\n 'Print the login URL instead of trying to open the browser',\n )\n .action(async (opts) => {\n await runCommandEffect(\n loginCommand(opts).pipe(Effect.provide(BaseLayerLive)),\n );\n });\n\nprogram\n .command('logout')\n .description('Log out of your Instant account')\n .action(async () => {\n return runCommandEffect(\n logoutCommand().pipe(Effect.provide(BaseLayerLive)),\n );\n });\n\nexport const infoDef = program\n .command('info')\n .description('Display CLI version and login status')\n .action(async () => {\n return runCommandEffect(\n infoCommand().pipe(\n Effect.provide(\n AuthLayerLive({\n coerce: false,\n allowAdminToken: false,\n }).pipe(Layer.catchAll(() => Layer.empty)), // make the auth layer optional\n ),\n ),\n );\n });\n\nexport const explorerDef = program\n .command('explorer')\n .description('Opens the Explorer in your browser')\n .option(\n '-a --app <app-id>',\n 'App ID to open the explorer to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action(async (opts) => {\n return runCommandEffect(\n explorerCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: true,\n coerceAuth: true,\n appId: opts.app,\n }),\n ),\n ),\n );\n });\n\nexport const queryDef = program\n .command('query')\n .argument('<query>', 'InstaQL query as JSON/JSON5')\n .option(\n '-a --app <app-id>',\n 'App ID to query. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--admin', 'Run the query as admin (bypasses permissions)')\n .option('--as-email <email>', 'Run the query as a specific user by email')\n .option('--as-guest', 'Run the query as an unauthenticated guest')\n .option(\n '--as-token <refresh-token>',\n 'Run the query as a user identified by refresh token',\n )\n .description('Run an InstaQL query against your app.')\n .action(async function (queryArg, opts) {\n return runCommandEffect(queryCmd(queryArg, opts));\n });\n\nexport const pullDef = program\n .command('pull')\n .argument(\n '[schema|perms|all]',\n 'Which configuration to pull. Defaults to `all`',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to pull to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option(\n '-p --package <react|react-native|core|admin|solid|svelte>',\n 'Which package to automatically install if there is not one installed already.',\n )\n .option(\n '--experimental-type-preservation',\n \"[Experimental] Preserve manual type changes like `status: i.json<'online' | 'offline'>()` when doing `instant-cli pull schema`\",\n )\n .description('Pull schema and perm files from production.')\n .addHelpText(\n 'after',\n `\nEnvironment Variables:\n INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)\n INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)\n`,\n )\n .action(async function (arg, inputOpts) {\n return runCommandEffect(\n pullCommand(arg as SchemaPermsOrBoth, inputOpts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: true,\n packageName: inputOpts.package as\n | 'react'\n | 'react-native'\n | 'core'\n | 'admin'\n | undefined,\n appId: inputOpts.app,\n }),\n ),\n ),\n );\n });\n\nexport const pushDef = program\n .command('push')\n .argument(\n '[schema|perms|all]',\n 'Which configuration to push. Defaults to `all`',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to push to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option(\n '--skip-check-types',\n \"Don't check types on the server when pushing schema\",\n )\n .option(\n '--rename [renames...]',\n 'List of full attribute names separated by a \":\"\\n Example:`push --rename posts.author:posts.creator stores.owner:stores.manager`',\n )\n .option(\n '-p --package <react|react-native|core|admin|solid|svelte>',\n 'Which package to automatically install if there is not one installed already.',\n )\n .description('Push schema and perm files to production.')\n .addHelpText(\n 'after',\n `\nEnvironment Variables:\n INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)\n INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)\n`,\n )\n .action(async function (arg, inputOpts) {\n return runCommandEffect(\n pushCommand(arg, inputOpts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: inputOpts.app,\n coerceLibraryInstall: true,\n coerceAuth: false,\n allowAdminToken: true,\n applyEnv: true,\n packageName:\n inputOpts.package as keyof typeof PACKAGE_ALIAS_AND_FULL_NAMES,\n }),\n ),\n ),\n );\n });\n\nexport const claimDef = program\n .command('claim')\n .description('Transfer a temporary app into your Instant account')\n .option(\n '-a --app <app-id>',\n 'App to claim. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action(async function (opts) {\n return runCommandEffect(\n claimCommand.pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n allowAdminToken: false,\n appId: opts.app,\n applyEnv: false,\n }),\n ),\n ),\n );\n });\n//// Program setup /////\n\nfunction globalOption(\n flags: string,\n description?: string,\n argParser?: (value: string, prev?: unknown) => unknown,\n) {\n const opt = new Option(flags, description);\n if (argParser) {\n opt.argParser(argParser);\n }\n // @ts-ignore\n // __global does not exist on `Option`,\n // but we use it in `getLocalAndGlobalOptions`, to produce\n // our own custom list of local and global options.\n // For more info, see the original PR:\n // https://github.com/instantdb/instant/pull/505\n opt.__global = true;\n return opt;\n}\n\nfunction getLocalAndGlobalOptions(cmd: any, helper: any) {\n const mixOfLocalAndGlobal = helper.visibleOptions(cmd);\n const localOptionsFromMix = mixOfLocalAndGlobal.filter(\n (option: any) => !option.__global,\n );\n const globalOptionsFromMix = mixOfLocalAndGlobal.filter(\n (option: any) => option.__global,\n );\n const globalOptions = helper.visibleGlobalOptions(cmd);\n\n return [localOptionsFromMix, globalOptionsFromMix.concat(globalOptions)];\n}\n\nfunction formatHelp(\n this: { showGlobalOptions: boolean },\n cmd: any,\n helper: any,\n) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth || 80;\n const itemIndentWidth = 2;\n const itemSeparatorWidth = 2; // between term and description\n function formatItem(term: string, description: string | undefined) {\n if (description) {\n const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;\n return helper.boxWrap(\n fullText,\n helpWidth - itemIndentWidth,\n termWidth + itemSeparatorWidth,\n );\n }\n return term;\n }\n function formatList(textArray: string[]) {\n return textArray.join('\\n').replace(/^/gm, ' '.repeat(itemIndentWidth));\n }\n\n // Usage\n let output = [`${helper.commandUsage(cmd)}`, ''];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(commandDescription, helpWidth, 0),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument: any) => {\n return formatItem(\n helper.argumentTerm(argument),\n helper.argumentDescription(argument),\n );\n });\n if (argumentList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Arguments'),\n formatList(argumentList),\n '',\n ]);\n }\n const [visibleOptions, visibleGlobalOptions] = getLocalAndGlobalOptions(\n cmd,\n helper,\n );\n\n // Options\n const optionList = visibleOptions.map((option: any) => {\n return formatItem(\n helper.optionTerm(option),\n helper.optionDescription(option),\n );\n });\n if (optionList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Options'),\n formatList(optionList),\n '',\n ]);\n }\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd: any) => {\n return formatItem(\n helper.subcommandTerm(cmd),\n helper.subcommandDescription(cmd),\n );\n });\n if (commandList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Commands'),\n formatList(commandList),\n '',\n ]);\n }\n\n if (this.showGlobalOptions) {\n const globalOptionList = visibleGlobalOptions.map((option: any) => {\n return formatItem(\n helper.optionTerm(option),\n helper.optionDescription(option),\n );\n });\n if (globalOptionList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Global Options'),\n formatList(globalOptionList),\n '',\n ]);\n }\n }\n\n return output.join('\\n');\n}\n\nprogram.configureHelp({\n showGlobalOptions: true,\n formatHelp,\n});\n\nprogram.parse(process.argv);\n"]}
@@ -12,6 +12,7 @@ export declare const OAuthServiceProvider: Schema.Struct<{
12
12
  id: typeof Schema.String;
13
13
  provider_name: typeof Schema.String;
14
14
  }>;
15
+ export declare const GoogleAppTypeSchema: Schema.Literal<["web", "ios", "android", "button-for-web"]>;
15
16
  export declare const OAuthClient: Schema.Struct<{
16
17
  id: typeof Schema.String;
17
18
  client_name: typeof Schema.String;
@@ -21,7 +22,10 @@ export declare const OAuthClient: Schema.Struct<{
21
22
  token_endpoint: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
22
23
  discovery_endpoint: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
23
24
  redirect_to: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
24
- meta: Schema.optional<typeof Schema.Any>;
25
+ meta: Schema.optional<Schema.Union<[Schema.extend<Schema.Struct<{
26
+ appType: Schema.optional<Schema.Literal<["web", "ios", "android", "button-for-web"]>>;
27
+ }>, Schema.Record$<typeof Schema.String, typeof Schema.Any>>, typeof Schema.Null]>>;
28
+ use_shared_credentials: Schema.optional<Schema.Union<[typeof Schema.Boolean, typeof Schema.Null]>>;
25
29
  }>;
26
30
  export declare const AddOAuthProviderResponse: Schema.Struct<{
27
31
  provider: Schema.Struct<{
@@ -39,7 +43,10 @@ export declare const AddOAuthClientResponse: Schema.Struct<{
39
43
  token_endpoint: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
40
44
  discovery_endpoint: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
41
45
  redirect_to: Schema.optional<Schema.Union<[typeof Schema.String, typeof Schema.Null]>>;
42
- meta: Schema.optional<typeof Schema.Any>;
46
+ meta: Schema.optional<Schema.Union<[Schema.extend<Schema.Struct<{
47
+ appType: Schema.optional<Schema.Literal<["web", "ios", "android", "button-for-web"]>>;
48
+ }>, Schema.Record$<typeof Schema.String, typeof Schema.Any>>, typeof Schema.Null]>>;
49
+ use_shared_credentials: Schema.optional<Schema.Union<[typeof Schema.Boolean, typeof Schema.Null]>>;
43
50
  }>;
44
51
  }>;
45
52
  export declare const AuthorizedOriginResponse: Schema.Struct<{
@@ -75,7 +82,12 @@ export declare const AppsAuthResponse: Schema.Struct<{
75
82
  readonly token_endpoint?: string | null | undefined;
76
83
  readonly discovery_endpoint?: string | null | undefined;
77
84
  readonly redirect_to?: string | null | undefined;
78
- readonly meta?: any;
85
+ readonly meta?: ({
86
+ readonly appType?: "android" | "web" | "ios" | "button-for-web" | undefined;
87
+ } & {
88
+ readonly [x: string]: any;
89
+ }) | null | undefined;
90
+ readonly use_shared_credentials?: boolean | null | undefined;
79
91
  }, {
80
92
  readonly id: string;
81
93
  readonly client_name: string;
@@ -85,7 +97,12 @@ export declare const AppsAuthResponse: Schema.Struct<{
85
97
  readonly token_endpoint?: string | null | undefined;
86
98
  readonly discovery_endpoint?: string | null | undefined;
87
99
  readonly redirect_to?: string | null | undefined;
88
- readonly meta?: any;
100
+ readonly meta?: ({
101
+ readonly appType?: "android" | "web" | "ios" | "button-for-web" | undefined;
102
+ } & {
103
+ readonly [x: string]: any;
104
+ }) | null | undefined;
105
+ readonly use_shared_credentials?: boolean | null | undefined;
89
106
  }, never>>>, typeof Schema.Null]>>;
90
107
  }>;
91
108
  export declare const getAppsAuth: () => Effect.Effect<{
@@ -107,7 +124,12 @@ export declare const getAppsAuth: () => Effect.Effect<{
107
124
  readonly token_endpoint?: string | null | undefined;
108
125
  readonly discovery_endpoint?: string | null | undefined;
109
126
  readonly redirect_to?: string | null | undefined;
110
- readonly meta?: any;
127
+ readonly meta?: ({
128
+ readonly appType?: "android" | "web" | "ios" | "button-for-web" | undefined;
129
+ } & {
130
+ readonly [x: string]: any;
131
+ }) | null | undefined;
132
+ readonly use_shared_credentials?: boolean | null | undefined;
111
133
  }[] | null | undefined;
112
134
  }, import("./http.ts").InstantHttpError | import("effect/Cause").TimeoutException | import("@effect/platform/HttpClientError").RequestError | import("effect/ParseResult").ParseError | import("@effect/platform/HttpClientError").ResponseError, InstantHttpAuthed | CurrentApp>;
113
135
  export declare const addOAuthProvider: (params: {
@@ -130,6 +152,7 @@ export declare const addOAuthClient: (params: {
130
152
  discoveryEndpoint?: string;
131
153
  redirectTo?: string;
132
154
  meta?: unknown;
155
+ useSharedCredentials?: boolean;
133
156
  }) => Effect.Effect<{
134
157
  readonly client: {
135
158
  readonly id: string;
@@ -140,7 +163,38 @@ export declare const addOAuthClient: (params: {
140
163
  readonly token_endpoint?: string | null | undefined;
141
164
  readonly discovery_endpoint?: string | null | undefined;
142
165
  readonly redirect_to?: string | null | undefined;
143
- readonly meta?: any;
166
+ readonly meta?: ({
167
+ readonly appType?: "android" | "web" | "ios" | "button-for-web" | undefined;
168
+ } & {
169
+ readonly [x: string]: any;
170
+ }) | null | undefined;
171
+ readonly use_shared_credentials?: boolean | null | undefined;
172
+ };
173
+ }, import("./http.ts").InstantHttpError | import("effect/Cause").TimeoutException | import("@effect/platform/HttpClientError").RequestError | import("effect/ParseResult").ParseError | import("@effect/platform/HttpClientError").ResponseError, InstantHttpAuthed | CurrentApp>;
174
+ export declare const updateOAuthClient: (params: {
175
+ oauthClientId: string;
176
+ clientId?: string | null;
177
+ clientSecret?: string | null;
178
+ discoveryEndpoint?: string | null;
179
+ redirectTo?: string | null;
180
+ meta?: unknown;
181
+ useSharedCredentials?: boolean | null;
182
+ }) => Effect.Effect<{
183
+ readonly client: {
184
+ readonly id: string;
185
+ readonly client_name: string;
186
+ readonly client_id?: string | null | undefined;
187
+ readonly provider_id: string;
188
+ readonly authorization_endpoint?: string | null | undefined;
189
+ readonly token_endpoint?: string | null | undefined;
190
+ readonly discovery_endpoint?: string | null | undefined;
191
+ readonly redirect_to?: string | null | undefined;
192
+ readonly meta?: ({
193
+ readonly appType?: "android" | "web" | "ios" | "button-for-web" | undefined;
194
+ } & {
195
+ readonly [x: string]: any;
196
+ }) | null | undefined;
197
+ readonly use_shared_credentials?: boolean | null | undefined;
144
198
  };
145
199
  }, import("./http.ts").InstantHttpError | import("effect/Cause").TimeoutException | import("@effect/platform/HttpClientError").RequestError | import("effect/ParseResult").ParseError | import("@effect/platform/HttpClientError").ResponseError, InstantHttpAuthed | CurrentApp>;
146
200
  export declare const promptForRedirectURI: (existingValue?: string | undefined) => Effect.Effect<string | undefined, BadArgsError, never>;
@@ -164,7 +218,12 @@ export declare const getOrCreateProvider: (type: "google" | "github" | "apple" |
164
218
  readonly token_endpoint?: string | null | undefined;
165
219
  readonly discovery_endpoint?: string | null | undefined;
166
220
  readonly redirect_to?: string | null | undefined;
167
- readonly meta?: any;
221
+ readonly meta?: ({
222
+ readonly appType?: "android" | "web" | "ios" | "button-for-web" | undefined;
223
+ } & {
224
+ readonly [x: string]: any;
225
+ }) | null | undefined;
226
+ readonly use_shared_credentials?: boolean | null | undefined;
168
227
  }[] | null | undefined;
169
228
  };
170
229
  provider: {
@@ -180,6 +239,54 @@ export declare const getClientNameAndProvider: (providerType: "google" | "github
180
239
  };
181
240
  clientName: string | undefined;
182
241
  }, BadArgsError | import("./ui.ts").UIError | import("./http.ts").InstantHttpError | import("effect/Cause").TimeoutException | import("@effect/platform/HttpClientError").RequestError | import("effect/ParseResult").ParseError | import("@effect/platform/HttpClientError").ResponseError, import("../context/globalOpts.ts").GlobalOpts | InstantHttpAuthed | CurrentApp>;
242
+ export declare const findClientByIdOrName: (params: {
243
+ id?: string;
244
+ name?: string;
245
+ }) => Effect.Effect<{
246
+ auth: {
247
+ readonly authorized_redirect_origins?: {
248
+ readonly id: string;
249
+ readonly service: "generic" | "vercel" | "netlify" | "custom-scheme";
250
+ readonly params: string[];
251
+ }[] | null | undefined;
252
+ readonly oauth_service_providers?: {
253
+ readonly id: string;
254
+ readonly provider_name: string;
255
+ }[] | null | undefined;
256
+ readonly oauth_clients?: {
257
+ readonly id: string;
258
+ readonly client_name: string;
259
+ readonly client_id?: string | null | undefined;
260
+ readonly provider_id: string;
261
+ readonly authorization_endpoint?: string | null | undefined;
262
+ readonly token_endpoint?: string | null | undefined;
263
+ readonly discovery_endpoint?: string | null | undefined;
264
+ readonly redirect_to?: string | null | undefined;
265
+ readonly meta?: ({
266
+ readonly appType?: "android" | "web" | "ios" | "button-for-web" | undefined;
267
+ } & {
268
+ readonly [x: string]: any;
269
+ }) | null | undefined;
270
+ readonly use_shared_credentials?: boolean | null | undefined;
271
+ }[] | null | undefined;
272
+ };
273
+ client: {
274
+ readonly id: string;
275
+ readonly client_name: string;
276
+ readonly client_id?: string | null | undefined;
277
+ readonly provider_id: string;
278
+ readonly authorization_endpoint?: string | null | undefined;
279
+ readonly token_endpoint?: string | null | undefined;
280
+ readonly discovery_endpoint?: string | null | undefined;
281
+ readonly redirect_to?: string | null | undefined;
282
+ readonly meta?: ({
283
+ readonly appType?: "android" | "web" | "ios" | "button-for-web" | undefined;
284
+ } & {
285
+ readonly [x: string]: any;
286
+ }) | null | undefined;
287
+ readonly use_shared_credentials?: boolean | null | undefined;
288
+ };
289
+ }, BadArgsError | import("./http.ts").InstantHttpError | import("effect/Cause").TimeoutException | import("@effect/platform/HttpClientError").RequestError | import("effect/ParseResult").ParseError | import("@effect/platform/HttpClientError").ResponseError, InstantHttpAuthed | CurrentApp>;
183
290
  export declare const removeAuthorizedOrigin: (originId: string) => Effect.Effect<{
184
291
  readonly origin: {
185
292
  readonly id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/lib/oauth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAe,MAAM,WAAW,CAAC;AAS3D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,eAAO,MAAM,uBAAuB,mEAKnC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;EAG/B,CAAC;AAMH,eAAO,MAAM,WAAW;;;;;;;;;;EAUtB,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;EAEnC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAEjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;EAEnC,CAAC;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