@shopify/cli-kit 3.45.0-pre.4 → 3.45.0
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.
- package/assets/cli-ruby/Gemfile +1 -0
- package/assets/cli-ruby/docs/contributors/testing.md +2 -2
- package/assets/cli-ruby/lib/project_types/theme/commands/serve.rb +0 -2
- package/assets/cli-ruby/lib/shopify_cli/api.rb +2 -3
- package/assets/cli-ruby/lib/shopify_cli/context.rb +4 -2
- package/assets/cli-ruby/lib/shopify_cli/messages/messages.rb +1 -1
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/proxy.rb +6 -1
- package/assets/cli-ruby/lib/shopify_cli/theme/dev_server.rb +8 -14
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer/operation.rb +4 -12
- package/assets/cli-ruby/lib/shopify_cli/theme/syncer.rb +1 -1
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/color.rb +1 -1
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/formatter.rb +1 -0
- package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +1 -1
- package/dist/private/node/api/graphql.d.ts +4 -4
- package/dist/private/node/api/graphql.js +4 -13
- package/dist/private/node/api/graphql.js.map +1 -1
- package/dist/private/node/conf-store.d.ts +2 -1
- package/dist/private/node/conf-store.js +3 -2
- package/dist/private/node/conf-store.js.map +1 -1
- package/dist/private/node/context/deprecations-store.d.ts +12 -0
- package/dist/private/node/context/deprecations-store.js +35 -0
- package/dist/private/node/context/deprecations-store.js.map +1 -0
- package/dist/private/node/session.d.ts +2 -2
- package/dist/private/node/session.js +4 -4
- package/dist/private/node/session.js.map +1 -1
- package/dist/private/node/ui/components/AutocompletePrompt.js.map +1 -1
- package/dist/private/node/ui/components/AutocompletePrompt.test.js +5 -5
- package/dist/private/node/ui/components/AutocompletePrompt.test.js.map +1 -1
- package/dist/private/node/ui/components/FullScreen.js +9 -10
- package/dist/private/node/ui/components/FullScreen.js.map +1 -1
- package/dist/private/node/ui/components/SelectPrompt.js +1 -1
- package/dist/private/node/ui/components/SelectPrompt.js.map +1 -1
- package/dist/private/node/ui/components/SelectPrompt.test.js +16 -0
- package/dist/private/node/ui/components/SelectPrompt.test.js.map +1 -1
- package/dist/private/node/ui/components/Table/Row.d.ts +1 -1
- package/dist/private/node/ui/components/Table/Table.d.ts +1 -1
- package/dist/private/node/ui/components/Tasks.test.js +14 -22
- package/dist/private/node/ui/components/Tasks.test.js.map +1 -1
- package/dist/public/common/version.d.ts +1 -1
- package/dist/public/common/version.js +1 -1
- package/dist/public/common/version.js.map +1 -1
- package/dist/public/node/analytics.js +10 -2
- package/dist/public/node/analytics.js.map +1 -1
- package/dist/public/node/api/admin.d.ts +1 -1
- package/dist/public/node/api/admin.js +10 -3
- package/dist/public/node/api/admin.js.map +1 -1
- package/dist/public/node/api/graphql.d.ts +27 -0
- package/dist/public/node/api/graphql.js +26 -0
- package/dist/public/node/api/graphql.js.map +1 -0
- package/dist/public/node/api/partners.d.ts +8 -1
- package/dist/public/node/api/partners.js +28 -2
- package/dist/public/node/api/partners.js.map +1 -1
- package/dist/public/node/cli.d.ts +0 -1
- package/dist/public/node/cli.js +0 -5
- package/dist/public/node/cli.js.map +1 -1
- package/dist/public/node/crypto.d.ts +7 -0
- package/dist/public/node/crypto.js +9 -0
- package/dist/public/node/crypto.js.map +1 -1
- package/dist/public/node/environment.d.ts +12 -0
- package/dist/public/node/environment.js +17 -0
- package/dist/public/node/environment.js.map +1 -1
- package/dist/public/node/environments.js +12 -4
- package/dist/public/node/environments.js.map +1 -1
- package/dist/public/node/git.d.ts +15 -0
- package/dist/public/node/git.js +23 -0
- package/dist/public/node/git.js.map +1 -1
- package/dist/public/node/hooks/deprecations.d.ts +7 -0
- package/dist/public/node/hooks/deprecations.js +46 -0
- package/dist/public/node/hooks/deprecations.js.map +1 -0
- package/dist/public/node/hooks/postrun.js +2 -0
- package/dist/public/node/hooks/postrun.js.map +1 -1
- package/dist/public/node/liquid.js +4 -0
- package/dist/public/node/liquid.js.map +1 -1
- package/dist/public/node/metadata.d.ts +10 -1
- package/dist/public/node/metadata.js.map +1 -1
- package/dist/public/node/monorail.d.ts +2 -1
- package/dist/public/node/monorail.js +1 -1
- package/dist/public/node/monorail.js.map +1 -1
- package/dist/public/node/plugins.d.ts +2 -1
- package/dist/public/node/plugins.js +2 -1
- package/dist/public/node/plugins.js.map +1 -1
- package/dist/public/node/ruby.d.ts +7 -0
- package/dist/public/node/ruby.js +29 -8
- package/dist/public/node/ruby.js.map +1 -1
- package/dist/public/node/session.d.ts +2 -2
- package/dist/public/node/session.js +4 -4
- package/dist/public/node/session.js.map +1 -1
- package/dist/public/node/ui.d.ts +2 -1
- package/dist/public/node/ui.js +2 -1
- package/dist/public/node/ui.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/public/node/api/oxygen.d.ts +0 -22
- package/dist/public/node/api/oxygen.js +0 -40
- package/dist/public/node/api/oxygen.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tasks.test.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Tasks.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,EAAC,MAAM,YAAY,CAAA;AACtC,OAAO,EAAC,wBAAwB,EAAC,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAC,QAAQ,EAAC,MAAM,mCAAmC,CAAA;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAA;AAE1C,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,IAAI,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QACpD,QAAQ;QACR,MAAM,iBAAiB,GAAG,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,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import {Task, Tasks} from './Tasks.js'\nimport {getLastFrameAfterUnmount} from '../../testing/ui.js'\nimport {unstyled} from '../../../../public/node/output.js'\nimport React from 'react'\nimport {describe, expect, test, vi} from 'vitest'\nimport {render} from 'ink-testing-library'\n\ndescribe('Tasks', () => {\n test('shows a loading state at the start', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 1 ...\"\n `)\n expect(firstTaskFunction).toHaveBeenCalled()\n })\n\n test('shows nothing at the end in case of success', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {})\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n const secondTask = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n // When\n\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(getLastFrameAfterUnmount(renderInstance)).toMatchInlineSnapshot('\"\"')\n })\n\n test('shows nothing at the end in case of success', async () => {\n // Given\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n throw new Error('something went wrong')\n },\n }\n\n const secondTask = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(getLastFrameAfterUnmount(renderInstance)).toMatchInlineSnapshot('\"\"')\n expect(secondTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('it supports subtasks', async () => {\n // Given\n const firstSubtaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: async () => {\n return [\n {\n title: 'subtask 1',\n task: firstSubtaskFunction,\n },\n {\n title: 'subtask 2',\n task: async () => {},\n },\n ]\n },\n }\n\n const secondTask = {\n title: 'task 2',\n task: async () => {},\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n subtask 1 ...\"\n `)\n\n expect(firstSubtaskFunction).toHaveBeenCalled()\n })\n\n test('supports skipping', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n skip: () => true,\n }\n\n const secondTask = {\n title: 'task 2',\n task: async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 2 ...\"\n `)\n expect(firstTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('supports skipping a subtask', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const secondSubTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: async () => {\n return [\n {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n skip: () => true,\n },\n {\n title: 'subtask 2',\n task: secondSubTaskFunction,\n },\n ]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n subtask 2 ...\"\n `)\n\n expect(firstSubTaskFunction).toHaveBeenCalledTimes(0)\n expect(secondSubTaskFunction).toHaveBeenCalled()\n })\n\n test('supports retrying', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount < task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask: Task = {\n title: 'task 1',\n task: firstTaskFunction,\n retry: 3,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 1 ...\"\n `)\n expect(firstTask.retryCount).toBe(3)\n expect(firstTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n })\n\n test('supports retrying up to a limit', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount <= task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask: Task = {\n title: 'task 1',\n task: firstTaskFunction,\n retry: 3,\n }\n\n const secondTask: Task = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(getLastFrameAfterUnmount(renderInstance)!)).toMatchInlineSnapshot('\"\"')\n expect(firstTask.retryCount).toBe(3)\n expect(firstTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n expect(secondTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('supports retrying a subtask', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount < task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstSubTask: Task = {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n retry: 3,\n }\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n return [firstSubTask]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n subtask 1 ...\"\n `)\n expect(firstSubTask.retryCount).toBe(3)\n expect(firstSubTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n })\n\n test('supports retrying a subtask up to a limit', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount <= task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const secondSubTaskFunction = vi.fn(async () => {})\n\n const firstSubTask: Task = {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n retry: 3,\n }\n\n const secondSubTask: Task = {\n title: 'subtask 2',\n task: secondSubTaskFunction,\n }\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n return [firstSubTask, secondSubTask]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(getLastFrameAfterUnmount(renderInstance)!)).toMatchInlineSnapshot('\"\"')\n expect(firstSubTask.retryCount).toBe(3)\n expect(firstSubTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n expect(secondSubTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('has a context', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (ctx) => {\n ctx.foo = 'bar'\n })\n\n const firstTask: Task<{foo: string}> = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n const secondTask: Task<{foo: string}> = {\n title: 'task 2',\n task: async (ctx) => {\n if (ctx.foo !== 'bar') {\n throw new Error('context is not shared')\n }\n },\n }\n\n const thirdTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const thirdTask: Task<{foo: string}> = {\n title: 'task 3',\n task: thirdTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask, thirdTask]} silent={false} />)\n\n // wait for next tick\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 3 ...\"\n `)\n expect(thirdTaskFunction).toHaveBeenCalled()\n })\n\n test('has an onComplete function that is called with the context', async () => {\n // Given\n const taskFunction = vi.fn(async (ctx) => {\n ctx.foo = 'bar'\n })\n\n const task: Task<{foo: string}> = {\n title: 'task 1',\n task: taskFunction,\n }\n\n // When\n const context = await new Promise((resolve, _reject) => {\n render(<Tasks tasks={[task]} silent={false} onComplete={resolve} />)\n })\n\n // Then\n expect(context).toEqual({foo: 'bar'})\n })\n})\n"]}
|
|
1
|
+
{"version":3,"file":"Tasks.test.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Tasks.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,EAAC,MAAM,YAAY,CAAA;A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,KAAK,IAAI,EAAE;QAC5E,QAAQ;QACR,MAAM,YAAY,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YACvC,GAAG,CAAC,GAAG,GAAG,KAAK,CAAA;QACjB,CAAC,CAAC,CAAA;QAEF,MAAM,IAAI,GAAwB;YAChC,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,YAAY;SACnB,CAAA;QAED,OAAO;QACP,MAAM,OAAO,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;YACrD,MAAM,CAAC,oBAAC,KAAK,IAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,GAAI,CAAC,CAAA;QACtE,CAAC,CAAC,CAAA;QAEF,OAAO;QACP,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAC,GAAG,EAAE,KAAK,EAAC,CAAC,CAAA;IACvC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,KAAK,UAAU,eAAe;IAC5B,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAC1D,CAAC","sourcesContent":["import {Task, Tasks} from './Tasks.js'\nimport {getLastFrameAfterUnmount} from '../../testing/ui.js'\nimport {unstyled} from '../../../../public/node/output.js'\nimport React from 'react'\nimport {describe, expect, test, vi} from 'vitest'\nimport {render} from 'ink-testing-library'\n\ndescribe('Tasks', () => {\n test('shows a loading state at the start', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 1 ...\"\n `)\n expect(firstTaskFunction).toHaveBeenCalled()\n })\n\n test('shows nothing at the end in case of success', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {})\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n const secondTask = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n // When\n\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(getLastFrameAfterUnmount(renderInstance)).toMatchInlineSnapshot('\"\"')\n })\n\n test('shows nothing at the end in case of success', async () => {\n // Given\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n throw new Error('something went wrong')\n },\n }\n\n const secondTask = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(getLastFrameAfterUnmount(renderInstance)).toMatchInlineSnapshot('\"\"')\n expect(secondTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('it supports subtasks', async () => {\n // Given\n const firstSubtaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: async () => {\n return [\n {\n title: 'subtask 1',\n task: firstSubtaskFunction,\n },\n {\n title: 'subtask 2',\n task: async () => {},\n },\n ]\n },\n }\n\n const secondTask = {\n title: 'task 2',\n task: async () => {},\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n subtask 1 ...\"\n `)\n\n expect(firstSubtaskFunction).toHaveBeenCalled()\n })\n\n test('supports skipping', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n skip: () => true,\n }\n\n const secondTask = {\n title: 'task 2',\n task: async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 2 ...\"\n `)\n expect(firstTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('supports skipping a subtask', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const secondSubTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: async () => {\n return [\n {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n skip: () => true,\n },\n {\n title: 'subtask 2',\n task: secondSubTaskFunction,\n },\n ]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n subtask 2 ...\"\n `)\n\n expect(firstSubTaskFunction).toHaveBeenCalledTimes(0)\n expect(secondSubTaskFunction).toHaveBeenCalled()\n })\n\n test('supports retrying', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount < task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask: Task = {\n title: 'task 1',\n task: firstTaskFunction,\n retry: 3,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 1 ...\"\n `)\n expect(firstTask.retryCount).toBe(3)\n expect(firstTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n })\n\n test('supports retrying up to a limit', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount <= task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask: Task = {\n title: 'task 1',\n task: firstTaskFunction,\n retry: 3,\n }\n\n const secondTask: Task = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(getLastFrameAfterUnmount(renderInstance)!)).toMatchInlineSnapshot('\"\"')\n expect(firstTask.retryCount).toBe(3)\n expect(firstTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n expect(secondTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('supports retrying a subtask', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount < task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstSubTask: Task = {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n retry: 3,\n }\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n return [firstSubTask]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n subtask 1 ...\"\n `)\n expect(firstSubTask.retryCount).toBe(3)\n expect(firstSubTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n })\n\n test('supports retrying a subtask up to a limit', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount <= task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const secondSubTaskFunction = vi.fn(async () => {})\n\n const firstSubTask: Task = {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n retry: 3,\n }\n\n const secondSubTask: Task = {\n title: 'subtask 2',\n task: secondSubTaskFunction,\n }\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n return [firstSubTask, secondSubTask]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(getLastFrameAfterUnmount(renderInstance)!)).toMatchInlineSnapshot('\"\"')\n expect(firstSubTask.retryCount).toBe(3)\n expect(firstSubTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n expect(secondSubTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('has a context', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (ctx) => {\n ctx.foo = 'bar'\n })\n\n const firstTask: Task<{foo: string}> = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n const secondTask: Task<{foo: string}> = {\n title: 'task 2',\n task: async (ctx) => {\n if (ctx.foo !== 'bar') {\n throw new Error('context is not shared')\n }\n },\n }\n\n const thirdTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const thirdTask: Task<{foo: string}> = {\n title: 'task 3',\n task: thirdTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask, thirdTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 3 ...\"\n `)\n expect(thirdTaskFunction).toHaveBeenCalled()\n })\n\n test('has an onComplete function that is called with the context', async () => {\n // Given\n const taskFunction = vi.fn(async (ctx) => {\n ctx.foo = 'bar'\n })\n\n const task: Task<{foo: string}> = {\n title: 'task 1',\n task: taskFunction,\n }\n\n // When\n const context = await new Promise((resolve, _reject) => {\n render(<Tasks tasks={[task]} silent={false} onComplete={resolve} />)\n })\n\n // Then\n expect(context).toEqual({foo: 'bar'})\n })\n})\n\nasync function taskHasRendered() {\n await new Promise((resolve) => setTimeout(resolve, 100))\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CLI_KIT_VERSION = "3.45.0
|
|
1
|
+
export declare const CLI_KIT_VERSION = "3.45.0";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CLI_KIT_VERSION = '3.45.0
|
|
1
|
+
export const CLI_KIT_VERSION = '3.45.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const CLI_KIT_VERSION = '3.45.0'\n"]}
|
|
@@ -38,7 +38,7 @@ export async function reportAnalyticsEvent(options) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
async function buildPayload({ config, errorMessage }) {
|
|
41
|
-
const { commandStartOptions, ...sensitiveMetadata } = metadata.getAllSensitiveMetadata();
|
|
41
|
+
const { commandStartOptions, environmentFlags, ...sensitiveMetadata } = metadata.getAllSensitiveMetadata();
|
|
42
42
|
if (commandStartOptions === undefined) {
|
|
43
43
|
outputDebug('Unable to log analytics event - no information on executed command');
|
|
44
44
|
return;
|
|
@@ -49,7 +49,7 @@ async function buildPayload({ config, errorMessage }) {
|
|
|
49
49
|
const { '@shopify/app': appSensitive, ...otherPluginsSensitive } = await fanoutHooks(config, 'sensitive_command_metadata', {});
|
|
50
50
|
const environmentData = await getEnvironmentData(config);
|
|
51
51
|
const sensitiveEnvironmentData = await getSensitiveEnvironmentData(config);
|
|
52
|
-
|
|
52
|
+
const payload = {
|
|
53
53
|
public: {
|
|
54
54
|
command: startCommand,
|
|
55
55
|
time_start: startTime,
|
|
@@ -66,6 +66,7 @@ async function buildPayload({ config, errorMessage }) {
|
|
|
66
66
|
},
|
|
67
67
|
sensitive: {
|
|
68
68
|
args: startArgs.join(' '),
|
|
69
|
+
cmd_all_environment_flags: environmentFlags,
|
|
69
70
|
error_message: errorMessage,
|
|
70
71
|
...appSensitive,
|
|
71
72
|
...sensitiveEnvironmentData,
|
|
@@ -78,5 +79,12 @@ async function buildPayload({ config, errorMessage }) {
|
|
|
78
79
|
}),
|
|
79
80
|
},
|
|
80
81
|
};
|
|
82
|
+
return sanitizePayload(payload);
|
|
83
|
+
}
|
|
84
|
+
function sanitizePayload(payload) {
|
|
85
|
+
const payloadString = JSON.stringify(payload);
|
|
86
|
+
// Remove Theme Access passwords from the payload
|
|
87
|
+
const sanitizedPayloadString = payloadString.replace(/shptka_\w*/g, '*****');
|
|
88
|
+
return JSON.parse(sanitizedPayloadString);
|
|
81
89
|
}
|
|
82
90
|
//# sourceMappingURL=analytics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/public/node/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,WAAW,CAAA;AAChD,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAA;AACnF,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,EAAC,oBAAoB,EAA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S;YACnC,WAAW,EAAE,eAAe;YAC5B,YAAY,EAAE,CAAC,MAAM,WAAW,EAAE,CAAC,IAAI,EAAE;YACzC,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;YAC9C,WAAW,EAAE,MAAM,SAAS,EAAE;YAC9B,GAAG,eAAe;YAClB,GAAG,SAAS;YACZ,GAAG,QAAQ,CAAC,oBAAoB,EAAE;SACnC;QACD,SAAS,EAAE;YACT,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;YACzB,yBAAyB,EAAE,gBAAgB;YAC3C,aAAa,EAAE,YAAY;YAC3B,GAAG,YAAY;YACf,GAAG,wBAAwB;YAC3B,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC;gBACvB,GAAG,iBAAiB;gBACpB,WAAW,EAAE;oBACX,GAAG,kBAAkB;iBACtB;gBACD,cAAc,EAAE,EAAC,GAAG,qBAAqB,EAAC;aAC3C,CAAC;SACH;KACF,CAAA;IAED,OAAO,eAAe,CAAC,OAAO,CAAC,CAAA;AACjC,CAAC;AAED,SAAS,eAAe,CAAC,OAAe;IACtC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;IAC7C,iDAAiD;IACjD,MAAM,sBAAsB,GAAG,aAAa,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IAC5E,OAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;AAC3C,CAAC","sourcesContent":["import {version as rubyVersion} from './ruby.js'\nimport {alwaysLogAnalytics, analyticsDisabled, isShopify} from './context/local.js'\nimport * as metadata from './metadata.js'\nimport {publishMonorailEvent, MONORAIL_COMMAND_TOPIC} from './monorail.js'\nimport {fanoutHooks} from './plugins.js'\nimport {outputContent, outputDebug, outputToken} from '../../public/node/output.js'\nimport {getEnvironmentData, getSensitiveEnvironmentData} from '../../private/node/analytics.js'\nimport {CLI_KIT_VERSION} from '../common/version.js'\nimport {Interfaces} from '@oclif/core'\n\ninterface ReportAnalyticsEventOptions {\n config: Interfaces.Config\n errorMessage?: string\n}\n\n/**\n * Report an analytics event, sending it off to Monorail -- Shopify's internal analytics service.\n *\n * The payload for an event includes both generic data, and data gathered from installed plug-ins.\n *\n */\nexport async function reportAnalyticsEvent(options: ReportAnalyticsEventOptions): Promise<void> {\n try {\n const payload = await buildPayload(options)\n if (payload === undefined) {\n // Nothing to log\n return\n }\n if (!alwaysLogAnalytics() && analyticsDisabled()) {\n outputDebug(outputContent`Skipping command analytics, payload: ${outputToken.json(payload)}`)\n return\n }\n const response = await publishMonorailEvent(MONORAIL_COMMAND_TOPIC, payload.public, payload.sensitive)\n if (response.type === 'error') {\n outputDebug(response.message)\n }\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (error) {\n let message = 'Failed to report usage analytics'\n if (error instanceof Error) {\n message = message.concat(`: ${error.message}`)\n }\n outputDebug(message)\n }\n}\n\nasync function buildPayload({config, errorMessage}: ReportAnalyticsEventOptions) {\n const {commandStartOptions, environmentFlags, ...sensitiveMetadata} = metadata.getAllSensitiveMetadata()\n if (commandStartOptions === undefined) {\n outputDebug('Unable to log analytics event - no information on executed command')\n return\n }\n const {startCommand, startArgs, startTime} = commandStartOptions\n const currentTime = new Date().getTime()\n\n const {'@shopify/app': appPublic, ...otherPluginsPublic} = await fanoutHooks(config, 'public_command_metadata', {})\n const {'@shopify/app': appSensitive, ...otherPluginsSensitive} = await fanoutHooks(\n config,\n 'sensitive_command_metadata',\n {},\n )\n\n const environmentData = await getEnvironmentData(config)\n const sensitiveEnvironmentData = await getSensitiveEnvironmentData(config)\n\n const payload = {\n public: {\n command: startCommand,\n time_start: startTime,\n time_end: currentTime,\n total_time: currentTime - startTime,\n success: errorMessage === undefined,\n cli_version: CLI_KIT_VERSION,\n ruby_version: (await rubyVersion()) || '',\n node_version: process.version.replace('v', ''),\n is_employee: await isShopify(),\n ...environmentData,\n ...appPublic,\n ...metadata.getAllPublicMetadata(),\n },\n sensitive: {\n args: startArgs.join(' '),\n cmd_all_environment_flags: environmentFlags,\n error_message: errorMessage,\n ...appSensitive,\n ...sensitiveEnvironmentData,\n metadata: JSON.stringify({\n ...sensitiveMetadata,\n extraPublic: {\n ...otherPluginsPublic,\n },\n extraSensitive: {...otherPluginsSensitive},\n }),\n },\n }\n\n return sanitizePayload(payload)\n}\n\nfunction sanitizePayload(payload: object) {\n const payloadString = JSON.stringify(payload)\n // Remove Theme Access passwords from the payload\n const sanitizedPayloadString = payloadString.replace(/shptka_\\w*/g, '*****')\n return JSON.parse(sanitizedPayloadString)\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { graphqlRequest } from './graphql.js';
|
|
1
2
|
import { outputContent, outputToken } from '../../../public/node/output.js';
|
|
2
3
|
import { BugError, AbortError } from '../error.js';
|
|
3
|
-
import { graphqlRequest } from '../../../private/node/api/graphql.js';
|
|
4
4
|
import { restRequestBody, restRequestHeaders, restRequestUrl } from '../../../private/node/api/rest.js';
|
|
5
5
|
import { fetch } from '../http.js';
|
|
6
6
|
import { ClientError, gql } from 'graphql-request';
|
|
@@ -16,7 +16,7 @@ export async function adminRequest(query, session, variables) {
|
|
|
16
16
|
const api = 'Admin';
|
|
17
17
|
const version = await fetchApiVersion(session);
|
|
18
18
|
const url = adminUrl(session.storeFqdn, version);
|
|
19
|
-
return graphqlRequest(query, api, url, session.token, variables);
|
|
19
|
+
return graphqlRequest({ query, api, url, token: session.token, variables });
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* GraphQL query to retrieve the latest supported API version.
|
|
@@ -28,7 +28,14 @@ async function fetchApiVersion(session) {
|
|
|
28
28
|
const url = adminUrl(session.storeFqdn, 'unstable');
|
|
29
29
|
const query = apiVersionQuery();
|
|
30
30
|
try {
|
|
31
|
-
const data = await graphqlRequest(
|
|
31
|
+
const data = await graphqlRequest({
|
|
32
|
+
query,
|
|
33
|
+
api: 'Admin',
|
|
34
|
+
url,
|
|
35
|
+
token: session.token,
|
|
36
|
+
variables: {},
|
|
37
|
+
responseOptions: { handleErrors: false },
|
|
38
|
+
});
|
|
32
39
|
return data.publicApiVersions
|
|
33
40
|
.filter((item) => item.supported)
|
|
34
41
|
.map((item) => item.handle)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../../../src/public/node/api/admin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../../../src/public/node/api/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAmB,MAAM,cAAc,CAAA;AAE7D,OAAO,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,aAAa,CAAA;AAChD,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAC,MAAM,mCAAmC,CAAA;AACrG,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAChC,OAAO,EAAC,WAAW,EAAE,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEhD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,KAAa,EAAE,OAAqB,EAAE,SAA4B;IACtG,MAAM,GAAG,GAAG,OAAO,CAAA;IACnB,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAA;IAC9C,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAChD,OAAO,cAAc,CAAC,EAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,EAAC,CAAC,CAAA;AAC3E,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,eAAe,CAAC,OAAqB;IAClD,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,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AA;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAc,EACd,IAAY,EACZ,OAAqB,EACrB,WAAe,EACf,eAAyC,EAAE,EAC3C,UAAU,GAAG,UAAU;IAEvB,MAAM,GAAG,GAAG,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,CAAC,CAAA;IACnE,MAAM,IAAI,GAAG,eAAe,CAAI,WAAW,CAAC,CAAA;IAE5C,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAChC,OAAO;QACP,MAAM;QACN,IAAI;KACL,CAAC,CAAA;IAEF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAEpD,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE;KAChC,CAAA;AACH,CAAC","sourcesContent":["import {graphqlRequest, GraphQLVariables} from './graphql.js'\nimport {AdminSession} from '../session.js'\nimport {outputContent, outputToken} from '../../../public/node/output.js'\nimport {BugError, AbortError} from '../error.js'\nimport {restRequestBody, restRequestHeaders, restRequestUrl} from '../../../private/node/api/rest.js'\nimport {fetch} from '../http.js'\nimport {ClientError, gql} from 'graphql-request'\n\n/**\n * Executes a GraphQL query against the Admin API.\n *\n * @param query - GraphQL query to execute.\n * @param session - Shopify admin session including token and Store FQDN.\n * @param variables - GraphQL variables to pass to the query.\n * @returns The response of the query of generic type <T>.\n */\nexport async function adminRequest<T>(query: string, session: AdminSession, variables?: GraphQLVariables): Promise<T> {\n const api = 'Admin'\n const version = await fetchApiVersion(session)\n const url = adminUrl(session.storeFqdn, version)\n return graphqlRequest({query, api, url, token: session.token, variables})\n}\n\n/**\n * GraphQL query to retrieve the latest supported API version.\n *\n * @param session - Shopify admin session including token and Store FQDN.\n * @returns - The latest supported API version.\n */\nasync function fetchApiVersion(session: AdminSession): Promise<string> {\n const url = adminUrl(session.storeFqdn, 'unstable')\n const query = apiVersionQuery()\n try {\n const data: ApiVersionResponse = await graphqlRequest({\n query,\n api: 'Admin',\n url,\n token: session.token,\n variables: {},\n responseOptions: {handleErrors: false},\n })\n\n return data.publicApiVersions\n .filter((item) => item.supported)\n .map((item) => item.handle)\n .sort()\n .reverse()[0]!\n } catch (error) {\n if (error instanceof ClientError && error.response.status === 403) {\n const storeName = session.storeFqdn.replace('.myshopify.com', '')\n throw new AbortError(\n outputContent`Looks like you don't have access this dev store: (${outputToken.link(\n storeName,\n `https://${session.storeFqdn}`,\n )})`,\n outputContent`If you're not the owner, create a dev store staff account for yourself`,\n )\n }\n throw new BugError(`Unknown error connecting to your store`)\n }\n}\n\n/**\n * Returns the Admin API URL for the given store and version.\n *\n * @param store - Store FQDN.\n * @param version - API version.\n * @returns - Admin API URL.\n */\nfunction adminUrl(store: string, version: string | undefined): string {\n const realVersion = version || 'unstable'\n return `https://${store}/admin/api/${realVersion}/graphql.json`\n}\n\ninterface ApiVersionResponse {\n publicApiVersions: {handle: string; supported: boolean}[]\n}\n\n/**\n * GraphQL query string to retrieve the latest supported API version.\n *\n * @returns - A query string.\n */\nfunction apiVersionQuery(): string {\n return gql`\n query {\n publicApiVersions {\n handle\n supported\n }\n }\n `\n}\n\n/**\n * Executes a REST request against the Admin API.\n *\n * @param method - Request's HTTP method.\n * @param path - Path of the REST resource.\n * @param session - Shopify Admin session including token and Store FQDN.\n * @param requestBody - Request body of including REST resource specific parameters.\n * @param searchParams - Search params, appended to the URL.\n * @param apiVersion - Admin API version.\n * @returns - The {@link RestResponse}.\n */\nexport async function restRequest<T>(\n method: string,\n path: string,\n session: AdminSession,\n requestBody?: T,\n searchParams: {[name: string]: string} = {},\n apiVersion = 'unstable',\n): Promise<RestResponse> {\n const url = restRequestUrl(session, apiVersion, path, searchParams)\n const body = restRequestBody<T>(requestBody)\n\n const headers = restRequestHeaders(session)\n const response = await fetch(url, {\n headers,\n method,\n body,\n })\n\n const json = await response.json().catch(() => ({}))\n\n return {\n json,\n status: response.status,\n headers: response.headers.raw(),\n }\n}\n\n/**\n * Respose of a REST request.\n */\nexport interface RestResponse {\n /**\n * REST JSON respose.\n */\n // Using `any` to avoid introducing extra DTO layers.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n json: any\n\n /**\n * HTTP response status.\n */\n status: number\n\n /**\n * HTTP response headers.\n */\n headers: {[key: string]: string[]}\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { rawRequest, RequestDocument, Variables } from 'graphql-request';
|
|
2
|
+
export interface GraphQLVariables {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export type GraphQLResponse<T> = Awaited<ReturnType<typeof rawRequest<T>>>;
|
|
6
|
+
export interface GraphQLRequestOptions<T> {
|
|
7
|
+
query: RequestDocument;
|
|
8
|
+
api: string;
|
|
9
|
+
url: string;
|
|
10
|
+
token?: string;
|
|
11
|
+
addedHeaders?: {
|
|
12
|
+
[header: string]: string;
|
|
13
|
+
};
|
|
14
|
+
variables?: Variables;
|
|
15
|
+
responseOptions?: GraphQLResponseOptions<T>;
|
|
16
|
+
}
|
|
17
|
+
export interface GraphQLResponseOptions<T> {
|
|
18
|
+
handleErrors?: boolean;
|
|
19
|
+
onResponse?: (response: GraphQLResponse<T>) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Executes a GraphQL query to an endpoint.
|
|
23
|
+
*
|
|
24
|
+
* @param options - GraphQL request options.
|
|
25
|
+
* @returns The response of the query of generic type <T>.
|
|
26
|
+
*/
|
|
27
|
+
export declare function graphqlRequest<T>(options: GraphQLRequestOptions<T>): Promise<T>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { buildHeaders, httpsAgent } from '../../../private/node/api/headers.js';
|
|
2
|
+
import { debugLogRequestInfo, errorHandler } from '../../../private/node/api/graphql.js';
|
|
3
|
+
import { debugLogResponseInfo } from '../../../private/node/api.js';
|
|
4
|
+
import { GraphQLClient } from 'graphql-request';
|
|
5
|
+
/**
|
|
6
|
+
* Executes a GraphQL query to an endpoint.
|
|
7
|
+
*
|
|
8
|
+
* @param options - GraphQL request options.
|
|
9
|
+
* @returns The response of the query of generic type <T>.
|
|
10
|
+
*/
|
|
11
|
+
export async function graphqlRequest(options) {
|
|
12
|
+
const { query, api, url, token, addedHeaders, variables, responseOptions } = options;
|
|
13
|
+
const headers = {
|
|
14
|
+
...addedHeaders,
|
|
15
|
+
...buildHeaders(token),
|
|
16
|
+
};
|
|
17
|
+
debugLogRequestInfo(api, query, variables, headers);
|
|
18
|
+
const clientOptions = { agent: await httpsAgent(), headers };
|
|
19
|
+
const client = new GraphQLClient(url, clientOptions);
|
|
20
|
+
const response = await debugLogResponseInfo({ request: client.rawRequest(query, variables), url }, responseOptions?.handleErrors === false ? undefined : errorHandler(api));
|
|
21
|
+
if (responseOptions?.onResponse) {
|
|
22
|
+
responseOptions.onResponse(response);
|
|
23
|
+
}
|
|
24
|
+
return response.data;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=graphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../../src/public/node/api/graphql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,sCAAsC,CAAA;AAC7E,OAAO,EAAC,mBAAmB,EAAE,YAAY,EAAC,MAAM,sCAAsC,CAAA;AACtF,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAC,aAAa,EAAyC,MAAM,iBAAiB,CAAA;AAwBrF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,OAAiC;IACvE,MAAM,EAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAC,GAAG,OAAO,CAAA;IAClF,MAAM,OAAO,GAAG;QACd,GAAG,YAAY;QACf,GAAG,YAAY,CAAC,KAAK,CAAC;KACvB,CAAA;IAED,mBAAmB,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;IACnD,MAAM,aAAa,GAAG,EAAC,KAAK,EAAE,MAAM,UAAU,EAAE,EAAE,OAAO,EAAC,CAAA;IAC1D,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;IACpD,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CACzC,EAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAI,KAAe,EAAE,SAAS,CAAC,EAAE,GAAG,EAAC,EAChE,eAAe,EAAE,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CACxE,CAAA;IAED,IAAI,eAAe,EAAE,UAAU,EAAE;QAC/B,eAAe,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;KACrC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import {buildHeaders, httpsAgent} from '../../../private/node/api/headers.js'\nimport {debugLogRequestInfo, errorHandler} from '../../../private/node/api/graphql.js'\nimport {debugLogResponseInfo} from '../../../private/node/api.js'\nimport {GraphQLClient, rawRequest, RequestDocument, Variables} from 'graphql-request'\n\nexport interface GraphQLVariables {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any\n}\n\nexport type GraphQLResponse<T> = Awaited<ReturnType<typeof rawRequest<T>>>\n\nexport interface GraphQLRequestOptions<T> {\n query: RequestDocument\n api: string\n url: string\n token?: string\n addedHeaders?: {[header: string]: string}\n variables?: Variables\n responseOptions?: GraphQLResponseOptions<T>\n}\n\nexport interface GraphQLResponseOptions<T> {\n handleErrors?: boolean\n onResponse?: (response: GraphQLResponse<T>) => void\n}\n\n/**\n * Executes a GraphQL query to an endpoint.\n *\n * @param options - GraphQL request options.\n * @returns The response of the query of generic type <T>.\n */\nexport async function graphqlRequest<T>(options: GraphQLRequestOptions<T>): Promise<T> {\n const {query, api, url, token, addedHeaders, variables, responseOptions} = options\n const headers = {\n ...addedHeaders,\n ...buildHeaders(token),\n }\n\n debugLogRequestInfo(api, query, variables, headers)\n const clientOptions = {agent: await httpsAgent(), headers}\n const client = new GraphQLClient(url, clientOptions)\n const response = await debugLogResponseInfo(\n {request: client.rawRequest<T>(query as string, variables), url},\n responseOptions?.handleErrors === false ? undefined : errorHandler(api),\n )\n\n if (responseOptions?.onResponse) {\n responseOptions.onResponse(response)\n }\n\n return response.data\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphQLVariables } from '
|
|
1
|
+
import { GraphQLVariables, GraphQLResponse } from './graphql.js';
|
|
2
2
|
/**
|
|
3
3
|
* Executes a GraphQL query against the Partners API.
|
|
4
4
|
*
|
|
@@ -20,3 +20,10 @@ export declare function partnersRequest<T>(query: string, token: string, variabl
|
|
|
20
20
|
* @returns The response of the query.
|
|
21
21
|
*/
|
|
22
22
|
export declare function functionProxyRequest<T>(apiKey: string, query: unknown, token: string, variables?: unknown): Promise<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the next deprecation date from [GraphQL response extensions](https://www.apollographql.com/docs/resources/graphql-glossary/#extensions)
|
|
25
|
+
* if `response.extensions.deprecations` objects contain a `supportedUntilDate` (ISO 8601-formatted string).
|
|
26
|
+
*
|
|
27
|
+
* @param response - The response of the query.
|
|
28
|
+
*/
|
|
29
|
+
export declare function handleDeprecations<T>(response: GraphQLResponse<T>): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { graphqlRequest } from './graphql.js';
|
|
1
2
|
import { partnersFqdn } from '../context/fqdn.js';
|
|
2
|
-
import {
|
|
3
|
+
import { setNextDeprecationDate } from '../../../private/node/context/deprecations-store.js';
|
|
3
4
|
import { gql } from 'graphql-request';
|
|
4
5
|
/**
|
|
5
6
|
* Executes a GraphQL query against the Partners API.
|
|
@@ -13,7 +14,14 @@ export async function partnersRequest(query, token, variables) {
|
|
|
13
14
|
const api = 'Partners';
|
|
14
15
|
const fqdn = await partnersFqdn();
|
|
15
16
|
const url = `https://${fqdn}/api/cli/graphql`;
|
|
16
|
-
return graphqlRequest(
|
|
17
|
+
return graphqlRequest({
|
|
18
|
+
query,
|
|
19
|
+
api,
|
|
20
|
+
url,
|
|
21
|
+
token,
|
|
22
|
+
variables,
|
|
23
|
+
responseOptions: { onResponse: handleDeprecations },
|
|
24
|
+
});
|
|
17
25
|
}
|
|
18
26
|
/**
|
|
19
27
|
* Function queries are proxied through the script service proxy.
|
|
@@ -35,6 +43,7 @@ export async function functionProxyRequest(apiKey, query, token, variables) {
|
|
|
35
43
|
const proxyQuery = ScriptServiceProxyQuery;
|
|
36
44
|
const res = await partnersRequest(proxyQuery, token, proxyVariables);
|
|
37
45
|
const json = JSON.parse(res.scriptServiceProxy);
|
|
46
|
+
handleDeprecations(json);
|
|
38
47
|
return json;
|
|
39
48
|
}
|
|
40
49
|
const ScriptServiceProxyQuery = gql `
|
|
@@ -42,4 +51,21 @@ const ScriptServiceProxyQuery = gql `
|
|
|
42
51
|
scriptServiceProxy(apiKey: $api_key, query: $query, variables: $variables)
|
|
43
52
|
}
|
|
44
53
|
`;
|
|
54
|
+
/**
|
|
55
|
+
* Sets the next deprecation date from [GraphQL response extensions](https://www.apollographql.com/docs/resources/graphql-glossary/#extensions)
|
|
56
|
+
* if `response.extensions.deprecations` objects contain a `supportedUntilDate` (ISO 8601-formatted string).
|
|
57
|
+
*
|
|
58
|
+
* @param response - The response of the query.
|
|
59
|
+
*/
|
|
60
|
+
export function handleDeprecations(response) {
|
|
61
|
+
if (!response.extensions)
|
|
62
|
+
return;
|
|
63
|
+
const deprecationDates = [];
|
|
64
|
+
for (const deprecation of response.extensions.deprecations) {
|
|
65
|
+
if (deprecation.supportedUntilDate) {
|
|
66
|
+
deprecationDates.push(new Date(deprecation.supportedUntilDate));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
setNextDeprecationDate(deprecationDates);
|
|
70
|
+
}
|
|
45
71
|
//# sourceMappingURL=partners.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partners.js","sourceRoot":"","sources":["../../../../src/public/node/api/partners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"partners.js","sourceRoot":"","sources":["../../../../src/public/node/api/partners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAoC,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAC,sBAAsB,EAAC,MAAM,qDAAqD,CAAA;AAC1F,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAI,KAAa,EAAE,KAAa,EAAE,SAA4B;IACjG,MAAM,GAAG,GAAG,UAAU,CAAA;IACtB,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAA;IACjC,MAAM,GAAG,GAAG,WAAW,IAAI,kBAAkB,CAAA;IAC7C,OAAO,cAAc,CAAC;QACpB,KAAK;QACL,GAAG;QACH,GAAG;QACH,KAAK;QACL,SAAS;QACT,eAAe,EAAE,EAAC,UAAU,EAAE,kBAAkB,EAAC;KAClD,CAAC,CAAA;AACJ,CAAC;AAMD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,KAAc,EACd,KAAa,EACb,SAAmB;IAEnB,MAAM,cAAc,GAAG;QACrB,OAAO,EAAE,MAAM;QACf,KAAK;QACL,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,IAAI;KAC7C,CAAA;IACD,MAAM,UAAU,GAAG,uBAAuB,CAAA;IAC1C,MAAM,GAAG,GAAkB,MAAM,eAAe,CAAC,UAAU,EAAE,KAAK,EAAE,cAAc,CAAC,CAAA;IACnF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC/C,kBAAkB,CAAC,IAAI,CAAC,CAAA;IACxB,OAAO,IAAS,CAAA;AAClB,CAAC;AAED,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;CAIlC,CAAA;AAUD;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAI,QAA4B;IAChE,IAAI,CAAC,QAAQ,CAAC,UAAU;QAAE,OAAM;IAEhC,MAAM,gBAAgB,GAAW,EAAE,CAAA;IACnC,KAAK,MAAM,WAAW,IAAK,QAAQ,CAAC,UAA+B,CAAC,YAAY,EAAE;QAChF,IAAI,WAAW,CAAC,kBAAkB,EAAE;YAClC,gBAAgB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAA;SAChE;KACF;IAED,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;AAC1C,CAAC","sourcesContent":["import {graphqlRequest, GraphQLVariables, GraphQLResponse} from './graphql.js'\nimport {partnersFqdn} from '../context/fqdn.js'\nimport {setNextDeprecationDate} from '../../../private/node/context/deprecations-store.js'\nimport {gql} from 'graphql-request'\n\n/**\n * Executes a GraphQL query against the Partners API.\n *\n * @param query - GraphQL query to execute.\n * @param token - Partners token.\n * @param variables - GraphQL variables to pass to the query.\n * @returns The response of the query of generic type <T>.\n */\nexport async function partnersRequest<T>(query: string, token: string, variables?: GraphQLVariables): Promise<T> {\n const api = 'Partners'\n const fqdn = await partnersFqdn()\n const url = `https://${fqdn}/api/cli/graphql`\n return graphqlRequest({\n query,\n api,\n url,\n token,\n variables,\n responseOptions: {onResponse: handleDeprecations},\n })\n}\n\ninterface ProxyResponse {\n scriptServiceProxy: string\n}\n\n/**\n * Function queries are proxied through the script service proxy.\n * To execute a query, we encapsulate it inside another query (including the variables)\n * This is done automatically, you just need to provide the query and the variables.\n *\n * @param apiKey - APIKey of the app where the query will be executed.\n * @param query - GraphQL query to execute.\n * @param token - Partners token.\n * @param variables - GraphQL variables to pass to the query.\n * @returns The response of the query.\n */\nexport async function functionProxyRequest<T>(\n apiKey: string,\n query: unknown,\n token: string,\n variables?: unknown,\n): Promise<T> {\n const proxyVariables = {\n api_key: apiKey,\n query,\n variables: JSON.stringify(variables) || '{}',\n }\n const proxyQuery = ScriptServiceProxyQuery\n const res: ProxyResponse = await partnersRequest(proxyQuery, token, proxyVariables)\n const json = JSON.parse(res.scriptServiceProxy)\n handleDeprecations(json)\n return json as T\n}\n\nconst ScriptServiceProxyQuery = gql`\n query ProxyRequest($api_key: String, $query: String!, $variables: String) {\n scriptServiceProxy(apiKey: $api_key, query: $query, variables: $variables)\n }\n`\n\ninterface Deprecation {\n supportedUntilDate?: string\n}\n\ninterface WithDeprecations {\n deprecations: Deprecation[]\n}\n\n/**\n * Sets the next deprecation date from [GraphQL response extensions](https://www.apollographql.com/docs/resources/graphql-glossary/#extensions)\n * if `response.extensions.deprecations` objects contain a `supportedUntilDate` (ISO 8601-formatted string).\n *\n * @param response - The response of the query.\n */\nexport function handleDeprecations<T>(response: GraphQLResponse<T>): void {\n if (!response.extensions) return\n\n const deprecationDates: Date[] = []\n for (const deprecation of (response.extensions as WithDeprecations).deprecations) {\n if (deprecation.supportedUntilDate) {\n deprecationDates.push(new Date(deprecation.supportedUntilDate))\n }\n }\n\n setNextDeprecationDate(deprecationDates)\n}\n"]}
|
|
@@ -31,7 +31,6 @@ export declare function localCliPackage(): Promise<CliPackageInfo | undefined>;
|
|
|
31
31
|
* are shared across all the commands.
|
|
32
32
|
*/
|
|
33
33
|
export declare const globalFlags: {
|
|
34
|
-
environment: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
35
34
|
verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
36
35
|
};
|
|
37
36
|
export default runCLI;
|
package/dist/public/node/cli.js
CHANGED
|
@@ -108,11 +108,6 @@ export async function localCliPackage() {
|
|
|
108
108
|
* are shared across all the commands.
|
|
109
109
|
*/
|
|
110
110
|
export const globalFlags = {
|
|
111
|
-
environment: Flags.string({
|
|
112
|
-
hidden: true,
|
|
113
|
-
description: 'The environment to apply to the current command.',
|
|
114
|
-
env: 'SHOPIFY_FLAG_ENVIRONMENT',
|
|
115
|
-
}),
|
|
116
111
|
verbose: Flags.boolean({
|
|
117
112
|
hidden: false,
|
|
118
113
|
description: 'Increase the verbosity of the logs.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/public/node/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAajC,SAAS,yBAAyB,CAAC,OAA2C;IAC5E;;;;OAIG;IACH,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAA;KAC7C;IACD,IAAI,OAAO,CAAC,WAAW,EAAE;QACvB,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,aAAa,CAAA;KAC3E;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAsB;IACjD,yBAAyB,CAAC,OAAO,CAAC,CAAA;IAClC;;;;OAIG;IACH,MAAM,EAAC,YAAY,EAAC,GAAG,MAAM,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AM;KACP;IACD,MAAM,gBAAgB,GAAG;QACvB,GAAG,eAAe,CAAC,gBAAgB;QACnC,GAAG,eAAe,CAAC,eAAe;QAClC,GAAG,eAAe,CAAC,YAAY;KAChC,CAAA;IACD,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAA;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;QACrB,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,qCAAqC;QAClD,GAAG,EAAE,sBAAsB;KAC5B,CAAC;CACH,CAAA;AAED,eAAe,MAAM,CAAA","sourcesContent":["import {Flags} from '@oclif/core'\n\n/**\n * IMPORTANT NOTE: Imports in this module are dynamic to ensure that \"setupEnvironmentVariables\" can dynamically\n * set the DEBUG environment variable before the 'debug' package sets up its configuration when modules\n * are loaded statically.\n */\ninterface RunCLIOptions {\n /** The value of import.meta.url of the CLI executable module */\n moduleURL: string\n development: boolean\n}\n\nfunction setupEnvironmentVariables(options: Pick<RunCLIOptions, 'development'>) {\n /**\n * By setting DEBUG=* when --verbose is passed we are increasing the\n * verbosity of oclif. Oclif uses debug (https://www.npmjs.com/package/debug)\n * for logging, and it's configured through the DEBUG= environment variable.\n */\n if (process.argv.includes('--verbose')) {\n process.env.DEBUG = process.env.DEBUG ?? '*'\n }\n if (options.development) {\n process.env.SHOPIFY_CLI_ENV = process.env.SHOPIFY_CLI_ENV ?? 'development'\n }\n}\n\n/**\n * A function that abstracts away setting up the environment and running\n * a CLI\n * @param options - Options.\n */\nexport async function runCLI(options: RunCLIOptions): Promise<void> {\n setupEnvironmentVariables(options)\n /**\n * These imports need to be dynamic because if they are static\n * they are loaded before we set the DEBUG=* environment variable\n * and therefore it has no effect.\n */\n const {errorHandler} = await import('./error-handler.js')\n const {isDevelopment} = await import('./context/local.js')\n const {run, settings, flush} = await import('@oclif/core')\n\n if (isDevelopment()) {\n settings.debug = true\n }\n\n run(undefined, options.moduleURL)\n .then(() => flush())\n .catch(errorHandler)\n}\n\n/**\n * A function for create-x CLIs that automatically runs the \"init\" command.\n */\nexport async function runCreateCLI(options: RunCLIOptions): Promise<void> {\n setupEnvironmentVariables(options)\n\n const {findUpAndReadPackageJson} = await import('./node-package-manager.js')\n const {moduleDirectory} = await import('./path.js')\n\n const packageJson = await findUpAndReadPackageJson(moduleDirectory(options.moduleURL))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const packageName = (packageJson.content as any).name as string\n const name = packageName.replace('@shopify/create-', '')\n const initIndex = process.argv.findIndex((arg) => arg.includes('init'))\n if (initIndex === -1) {\n const initIndex =\n process.argv.findIndex((arg) => arg.match(new RegExp(`bin(\\\\/|\\\\\\\\)+(create-${name}|dev|run)`))) + 1\n process.argv.splice(initIndex, 0, 'init')\n }\n await runCLI(options)\n}\n\nexport async function useLocalCLIIfDetected(filepath: string): Promise<boolean> {\n const {isTruthy} = await import('../../private/node/context/utilities.js')\n const {environmentVariables} = await import('../../private/node/constants.js')\n const {joinPath: join} = await import('./path.js')\n const {exec} = await import('./system.js')\n\n // Temporary flag while we test out this feature and ensure it won't break anything!\n if (!isTruthy(process.env[environmentVariables.enableCliRedirect])) return false\n\n // Setting an env variable in the child process prevents accidental recursion.\n if (isTruthy(process.env[environmentVariables.skipCliRedirect])) return false\n\n // If already running via package manager, we can assume it's running correctly already.\n if (process.env.npm_config_user_agent) return false\n\n const cliPackage = await localCliPackage()\n if (!cliPackage) return false\n\n const correctExecutablePath = join(cliPackage.path, cliPackage.bin.shopify)\n if (correctExecutablePath === filepath) return false\n try {\n await exec(correctExecutablePath, process.argv.slice(2, process.argv.length), {\n stdio: 'inherit',\n env: {[environmentVariables.skipCliRedirect]: '1'},\n })\n // eslint-disable-next-line no-catch-all/no-catch-all, @typescript-eslint/no-explicit-any\n } catch (processError: any) {\n process.exit(processError.exitCode)\n }\n return true\n}\n\ninterface CliPackageInfo {\n path: string\n bin: {shopify: string}\n}\n\ninterface PackageJSON {\n dependencies?: {[packageName: string]: CliPackageInfo}\n devDependencies?: {[packageName: string]: CliPackageInfo}\n peerDependencies?: {[packageName: string]: CliPackageInfo}\n}\n\nexport async function localCliPackage(): Promise<CliPackageInfo | undefined> {\n const {captureOutput} = await import('./system.js')\n\n let npmListOutput = ''\n let localShopifyCLI: PackageJSON = {}\n try {\n npmListOutput = await captureOutput('npm', ['list', '@shopify/cli', '--json', '-l'])\n localShopifyCLI = JSON.parse(npmListOutput)\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (err) {\n return\n }\n const dependenciesList = {\n ...localShopifyCLI.peerDependencies,\n ...localShopifyCLI.devDependencies,\n ...localShopifyCLI.dependencies,\n }\n return dependenciesList['@shopify/cli']\n}\n\n/**\n * An object that contains the flags that\n * are shared across all the commands.\n */\nexport const globalFlags = {\n verbose: Flags.boolean({\n hidden: false,\n description: 'Increase the verbosity of the logs.',\n env: 'SHOPIFY_FLAG_VERBOSE',\n }),\n}\n\nexport default runCLI\n"]}
|
|
@@ -27,6 +27,13 @@ export declare function sha256(str: string): Buffer;
|
|
|
27
27
|
* @returns The SHA1 hash of the string.
|
|
28
28
|
*/
|
|
29
29
|
export declare function hashString(str: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Generate an MD5 hash of a buffer.
|
|
32
|
+
*
|
|
33
|
+
* @param buff - The file buffer to hash.
|
|
34
|
+
* @returns A string containing the MD5 hash.
|
|
35
|
+
*/
|
|
36
|
+
export declare function fileHash(buff: Buffer): string;
|
|
30
37
|
/**
|
|
31
38
|
* Generate random data of the provided size.
|
|
32
39
|
*
|
|
@@ -35,6 +35,15 @@ export function sha256(str) {
|
|
|
35
35
|
export function hashString(str) {
|
|
36
36
|
return crypto.createHash('sha1').update(str).digest('hex');
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Generate an MD5 hash of a buffer.
|
|
40
|
+
*
|
|
41
|
+
* @param buff - The file buffer to hash.
|
|
42
|
+
* @returns A string containing the MD5 hash.
|
|
43
|
+
*/
|
|
44
|
+
export function fileHash(buff) {
|
|
45
|
+
return crypto.createHash('md5').update(buff).digest('hex');
|
|
46
|
+
}
|
|
38
47
|
/**
|
|
39
48
|
* Generate random data of the provided size.
|
|
40
49
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/public/node/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAC3F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAA;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,MAAM,CAAC,UAAU,EAAE,CAAA;AAC5B,CAAC","sourcesContent":["import crypto from 'crypto'\n\n/**\n * Generate a random string in Hex format of the provided size.\n *\n * @param size - Number of bytes to be generated.\n * @returns A random string in Hex format.\n */\nexport function randomHex(size: number): string {\n return crypto.randomBytes(size).toString('hex')\n}\n\n/**\n * Encode a string in Base64 valid for URLs.\n *\n * @param str - The string to encode.\n * @returns The encoded string.\n */\nexport function base64URLEncode(str: Buffer): string {\n return str.toString('base64').replace(/\\+/g, '-').replace(/\\//g, '_').replace(/[=]/g, '')\n}\n\n/**\n * Generate the SHA256 hash of a string.\n *\n * @param str - The string to hash.\n * @returns The SHA256 hash of the string.\n */\nexport function sha256(str: string): Buffer {\n return crypto.createHash('sha256').update(str).digest()\n}\n\n/**\n * Generate the SHA1 hash of a string.\n *\n * @param str - The string to hash.\n * @returns The SHA1 hash of the string.\n */\nexport function hashString(str: string): string {\n return crypto.createHash('sha1').update(str).digest('hex')\n}\n\n/**\n * Generate random data of the provided size.\n *\n * @param size - Number of bytes to be generated.\n * @returns A buffer of random data.\n */\nexport function randomBytes(size: number): Buffer {\n return crypto.randomBytes(size)\n}\n\n/**\n * Generate a random UUID string.\n *\n * @returns A random UUID string.\n */\nexport function randomUUID(): string {\n return crypto.randomUUID()\n}\n"]}
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/public/node/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAC3F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAA;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,MAAM,CAAC,UAAU,EAAE,CAAA;AAC5B,CAAC","sourcesContent":["import crypto from 'crypto'\n\n/**\n * Generate a random string in Hex format of the provided size.\n *\n * @param size - Number of bytes to be generated.\n * @returns A random string in Hex format.\n */\nexport function randomHex(size: number): string {\n return crypto.randomBytes(size).toString('hex')\n}\n\n/**\n * Encode a string in Base64 valid for URLs.\n *\n * @param str - The string to encode.\n * @returns The encoded string.\n */\nexport function base64URLEncode(str: Buffer): string {\n return str.toString('base64').replace(/\\+/g, '-').replace(/\\//g, '_').replace(/[=]/g, '')\n}\n\n/**\n * Generate the SHA256 hash of a string.\n *\n * @param str - The string to hash.\n * @returns The SHA256 hash of the string.\n */\nexport function sha256(str: string): Buffer {\n return crypto.createHash('sha256').update(str).digest()\n}\n\n/**\n * Generate the SHA1 hash of a string.\n *\n * @param str - The string to hash.\n * @returns The SHA1 hash of the string.\n */\nexport function hashString(str: string): string {\n return crypto.createHash('sha1').update(str).digest('hex')\n}\n\n/**\n * Generate an MD5 hash of a buffer.\n *\n * @param buff - The file buffer to hash.\n * @returns A string containing the MD5 hash.\n */\nexport function fileHash(buff: Buffer): string {\n return crypto.createHash('md5').update(buff).digest('hex')\n}\n\n/**\n * Generate random data of the provided size.\n *\n * @param size - Number of bytes to be generated.\n * @returns A buffer of random data.\n */\nexport function randomBytes(size: number): Buffer {\n return crypto.randomBytes(size)\n}\n\n/**\n * Generate a random UUID string.\n *\n * @returns A random UUID string.\n */\nexport function randomUUID(): string {\n return crypto.randomUUID()\n}\n"]}
|
|
@@ -10,3 +10,15 @@
|
|
|
10
10
|
* @returns Current process environment variables.
|
|
11
11
|
*/
|
|
12
12
|
export declare function getEnvironmentVariables(): NodeJS.ProcessEnv;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the value of the SHOPIFY_CLI_PARTNERS_TOKEN environment variable.
|
|
15
|
+
*
|
|
16
|
+
* @returns Current process environment variables.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getPartnersToken(): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Check if the current proccess is running using the partners token.
|
|
21
|
+
*
|
|
22
|
+
* @returns True if the current proccess is running using the partners token.
|
|
23
|
+
*/
|
|
24
|
+
export declare function usePartnersToken(): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { environmentVariables } from '../../private/node/constants.js';
|
|
1
2
|
/**
|
|
2
3
|
* It returns the environment variables of the environment
|
|
3
4
|
* where the Node process is running.
|
|
@@ -11,4 +12,20 @@
|
|
|
11
12
|
export function getEnvironmentVariables() {
|
|
12
13
|
return process.env;
|
|
13
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns the value of the SHOPIFY_CLI_PARTNERS_TOKEN environment variable.
|
|
17
|
+
*
|
|
18
|
+
* @returns Current process environment variables.
|
|
19
|
+
*/
|
|
20
|
+
export function getPartnersToken() {
|
|
21
|
+
return getEnvironmentVariables()[environmentVariables.partnersToken];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if the current proccess is running using the partners token.
|
|
25
|
+
*
|
|
26
|
+
* @returns True if the current proccess is running using the partners token.
|
|
27
|
+
*/
|
|
28
|
+
export function usePartnersToken() {
|
|
29
|
+
return getPartnersToken() !== undefined;
|
|
30
|
+
}
|
|
14
31
|
//# sourceMappingURL=environment.js.map
|