@shopify/shop-minis-cli 0.0.138 → 0.0.139

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 (63) hide show
  1. package/build/commands/app/index.d.ts +2 -0
  2. package/build/commands/app/index.js +14 -0
  3. package/build/commands/app/index.js.map +1 -0
  4. package/build/commands/app/link.d.ts +2 -0
  5. package/build/commands/app/link.js +55 -0
  6. package/build/commands/app/link.js.map +1 -0
  7. package/build/commands/app/list.d.ts +2 -0
  8. package/build/commands/app/list.js +37 -0
  9. package/build/commands/app/list.js.map +1 -0
  10. package/build/commands/app/unlink.d.ts +2 -0
  11. package/build/commands/app/unlink.js +47 -0
  12. package/build/commands/app/unlink.js.map +1 -0
  13. package/build/commands/codemod/releases/index.js +2 -0
  14. package/build/commands/codemod/releases/index.js.map +1 -1
  15. package/build/commands/codemod/releases/v0-0-139.d.ts +3 -0
  16. package/build/commands/codemod/releases/v0-0-139.js +26 -0
  17. package/build/commands/codemod/releases/v0-0-139.js.map +1 -0
  18. package/build/commands/dev/utils/cache-cleanup.d.ts +1 -0
  19. package/build/commands/dev/utils/cache-cleanup.js +45 -0
  20. package/build/commands/dev/utils/cache-cleanup.js.map +1 -0
  21. package/build/commands/dev/utils/default-screen.js +31 -16
  22. package/build/commands/dev/utils/default-screen.js.map +1 -1
  23. package/build/commands/dev/utils/simulator.js +4 -1
  24. package/build/commands/dev/utils/simulator.js.map +1 -1
  25. package/build/commands/setup/create.d.ts +2 -0
  26. package/build/commands/setup/create.js +77 -0
  27. package/build/commands/setup/create.js.map +1 -0
  28. package/build/commands/setup/index.js +2 -0
  29. package/build/commands/setup/index.js.map +1 -1
  30. package/build/data/get-linked-apps.d.ts +13 -0
  31. package/build/data/get-linked-apps.js +21 -0
  32. package/build/data/get-linked-apps.js.map +1 -0
  33. package/build/data/gql-client.js +6 -1
  34. package/build/data/gql-client.js.map +1 -1
  35. package/build/data/mini-create.d.ts +22 -0
  36. package/build/data/mini-create.js +39 -0
  37. package/build/data/mini-create.js.map +1 -0
  38. package/build/data/mini-link-app.d.ts +19 -0
  39. package/build/data/mini-link-app.js +29 -0
  40. package/build/data/mini-link-app.js.map +1 -0
  41. package/build/data/mini-unlink-app.d.ts +18 -0
  42. package/build/data/mini-unlink-app.js +25 -0
  43. package/build/data/mini-unlink-app.js.map +1 -0
  44. package/build/data/partners/query.d.ts +32 -0
  45. package/build/data/partners/query.js +123 -0
  46. package/build/data/partners/query.js.map +1 -0
  47. package/build/data/partners/types.d.ts +55 -0
  48. package/build/data/partners/types.js +6 -0
  49. package/build/data/partners/types.js.map +1 -0
  50. package/build/data/types/autogenerated/shop-minis-admin-api/gql.d.ts +32 -0
  51. package/build/data/types/autogenerated/shop-minis-admin-api/gql.js +4 -0
  52. package/build/data/types/autogenerated/shop-minis-admin-api/gql.js.map +1 -1
  53. package/build/data/types/autogenerated/shop-minis-admin-api/graphql.d.ts +213 -0
  54. package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js +365 -0
  55. package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js.map +1 -1
  56. package/build/index.js +2 -0
  57. package/build/index.js.map +1 -1
  58. package/build/schemas/manifest.schema.json +1 -7
  59. package/build/utils/sync-manifest.d.ts +5 -0
  60. package/build/utils/sync-manifest.js +23 -0
  61. package/build/utils/sync-manifest.js.map +1 -0
  62. package/package.json +2 -2
  63. package/scripts/graphql-codegen.ts +8 -2
@@ -1,9 +1,14 @@
1
1
  import { GraphQLClient } from 'graphql-request';
2
2
  import { SHOP_MINIS_ADMIN_API, SHOP_MINIS_ADMIN_API_KEY, } from '../commands/config.js';
3
- export const clientWithoutAuthorization = new GraphQLClient(SHOP_MINIS_ADMIN_API);
3
+ export const clientWithoutAuthorization = new GraphQLClient(SHOP_MINIS_ADMIN_API, {
4
+ headers: {
5
+ 'X-Shop-Minis-Experimental': '1',
6
+ },
7
+ });
4
8
  export const client = new GraphQLClient(SHOP_MINIS_ADMIN_API, {
5
9
  headers: {
6
10
  Authorization: `Bearer ${SHOP_MINIS_ADMIN_API_KEY}`,
11
+ 'X-Shop-Minis-Experimental': '1',
7
12
  },
8
13
  });
9
14
  //# sourceMappingURL=gql-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gql-client.js","sourceRoot":"","sources":["../../src/data/gql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAE7C,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,aAAa,CACzD,oBAAoB,CACrB,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,oBAAoB,EAAE;IAC5D,OAAO,EAAE;QACP,aAAa,EAAE,UAAU,wBAAwB,EAAE;KACpD;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"gql-client.js","sourceRoot":"","sources":["../../src/data/gql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAE7C,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,aAAa,CACzD,oBAAoB,EACpB;IACE,OAAO,EAAE;QACP,2BAA2B,EAAE,GAAG;KACjC;CACF,CACF,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,oBAAoB,EAAE;IAC5D,OAAO,EAAE;QACP,aAAa,EAAE,UAAU,wBAAwB,EAAE;QACnD,2BAA2B,EAAE,GAAG;KACjC;CACF,CAAC,CAAA"}
@@ -0,0 +1,22 @@
1
+ export interface MiniCreateParameters {
2
+ name: string;
3
+ handle: string;
4
+ appApiKey: string;
5
+ partnersAccessToken: string;
6
+ }
7
+ export declare const miniCreate: ({ name, handle, appApiKey, partnersAccessToken, }: MiniCreateParameters) => Promise<{
8
+ __typename?: "MiniCreatePayload" | undefined;
9
+ token?: string | null | undefined;
10
+ mini?: {
11
+ __typename?: "Mini" | undefined;
12
+ handle: string;
13
+ productionShopifyAppId: string;
14
+ developmentShopifyAppIds: string[];
15
+ } | null | undefined;
16
+ userErrors: {
17
+ __typename?: "MiniCreateUserError" | undefined;
18
+ code: import("./types/autogenerated/shop-minis-admin-api/graphql.js").MiniCreateUserErrorCode;
19
+ message: string;
20
+ field?: string[] | null | undefined;
21
+ }[];
22
+ }>;
@@ -0,0 +1,39 @@
1
+ import { graphql } from './types/autogenerated/shop-minis-admin-api/gql.js';
2
+ import { clientWithoutAuthorization } from './gql-client.js';
3
+ const miniCreateQuery = graphql(/* GraphQL */ `
4
+ mutation MiniCreate(
5
+ $name: String!
6
+ $handle: String!
7
+ $appApiKey: String!
8
+ $partnersAccessToken: String!
9
+ ) {
10
+ miniCreate(
11
+ name: $name
12
+ handle: $handle
13
+ appApiKey: $appApiKey
14
+ partnersAccessToken: $partnersAccessToken
15
+ ) {
16
+ mini {
17
+ handle
18
+ productionShopifyAppId
19
+ developmentShopifyAppIds
20
+ }
21
+ token
22
+ userErrors {
23
+ code
24
+ message
25
+ field
26
+ }
27
+ }
28
+ }
29
+ `);
30
+ export const miniCreate = async ({ name, handle, appApiKey, partnersAccessToken, }) => {
31
+ const response = await clientWithoutAuthorization.request(miniCreateQuery, {
32
+ name,
33
+ handle,
34
+ appApiKey,
35
+ partnersAccessToken,
36
+ });
37
+ return response.miniCreate;
38
+ };
39
+ //# sourceMappingURL=mini-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mini-create.js","sourceRoot":"","sources":["../../src/data/mini-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,mDAAmD,CAAA;AACzE,OAAO,EAAC,0BAA0B,EAAC,MAAM,iBAAiB,CAAA;AAE1D,MAAM,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B7C,CAAC,CAAA;AASF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,EAC/B,IAAI,EACJ,MAAM,EACN,SAAS,EACT,mBAAmB,GACE,EAAE,EAAE;IACzB,MAAM,QAAQ,GAAG,MAAM,0BAA0B,CAAC,OAAO,CAAC,eAAe,EAAE;QACzE,IAAI;QACJ,MAAM;QACN,SAAS;QACT,mBAAmB;KACpB,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,UAAU,CAAA;AAC5B,CAAC,CAAA"}
@@ -0,0 +1,19 @@
1
+ export interface MiniLinkAppParameters {
2
+ appApiKey: string;
3
+ partnersAccessToken: string;
4
+ }
5
+ export declare const miniLinkApp: ({ appApiKey, partnersAccessToken, }: MiniLinkAppParameters) => Promise<{
6
+ __typename?: "MiniLinkAppPayload" | undefined;
7
+ mini?: {
8
+ __typename?: "Mini" | undefined;
9
+ handle: string;
10
+ productionShopifyAppId: string;
11
+ developmentShopifyAppIds: string[];
12
+ } | null | undefined;
13
+ userErrors: {
14
+ __typename?: "MiniLinkAppUserError" | undefined;
15
+ code: import("./types/autogenerated/shop-minis-admin-api/graphql.js").MiniLinkAppUserErrorCode;
16
+ message: string;
17
+ field?: string[] | null | undefined;
18
+ }[];
19
+ }>;
@@ -0,0 +1,29 @@
1
+ import { graphql } from './types/autogenerated/shop-minis-admin-api/gql.js';
2
+ import { client } from './gql-client.js';
3
+ const miniLinkAppQuery = graphql(/* GraphQL */ `
4
+ mutation MiniLinkApp($appApiKey: String!, $partnersAccessToken: String!) {
5
+ miniLinkApp(
6
+ appApiKey: $appApiKey
7
+ partnersAccessToken: $partnersAccessToken
8
+ ) {
9
+ mini {
10
+ handle
11
+ productionShopifyAppId
12
+ developmentShopifyAppIds
13
+ }
14
+ userErrors {
15
+ code
16
+ message
17
+ field
18
+ }
19
+ }
20
+ }
21
+ `);
22
+ export const miniLinkApp = async ({ appApiKey, partnersAccessToken, }) => {
23
+ const data = await client.request(miniLinkAppQuery, {
24
+ appApiKey,
25
+ partnersAccessToken,
26
+ });
27
+ return data.miniLinkApp;
28
+ };
29
+ //# sourceMappingURL=mini-link-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mini-link-app.js","sourceRoot":"","sources":["../../src/data/mini-link-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,mDAAmD,CAAA;AACzE,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAA;AAEtC,MAAM,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;CAkB9C,CAAC,CAAA;AAOF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,EAChC,SAAS,EACT,mBAAmB,GACG,EAAE,EAAE;IAC1B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE;QAClD,SAAS;QACT,mBAAmB;KACpB,CAAC,CAAA;IAEF,OAAO,IAAI,CAAC,WAAW,CAAA;AACzB,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ export interface MiniUnlinkAppParameters {
2
+ appId: string;
3
+ }
4
+ export declare const miniUnlinkApp: ({ appId }: MiniUnlinkAppParameters) => Promise<{
5
+ __typename?: "MiniUnlinkAppPayload" | undefined;
6
+ mini?: {
7
+ __typename?: "Mini" | undefined;
8
+ handle: string;
9
+ productionShopifyAppId: string;
10
+ developmentShopifyAppIds: string[];
11
+ } | null | undefined;
12
+ userErrors: {
13
+ __typename?: "MiniUnlinkAppUserError" | undefined;
14
+ code: import("./types/autogenerated/shop-minis-admin-api/graphql.js").MiniUnlinkAppUserErrorCode;
15
+ message: string;
16
+ field?: string[] | null | undefined;
17
+ }[];
18
+ }>;
@@ -0,0 +1,25 @@
1
+ import { graphql } from './types/autogenerated/shop-minis-admin-api/gql.js';
2
+ import { client } from './gql-client.js';
3
+ const miniUnlinkAppQuery = graphql(/* GraphQL */ `
4
+ mutation MiniUnlinkApp($appId: ID!) {
5
+ miniUnlinkApp(appId: $appId) {
6
+ mini {
7
+ handle
8
+ productionShopifyAppId
9
+ developmentShopifyAppIds
10
+ }
11
+ userErrors {
12
+ code
13
+ message
14
+ field
15
+ }
16
+ }
17
+ }
18
+ `);
19
+ export const miniUnlinkApp = async ({ appId }) => {
20
+ const data = await client.request(miniUnlinkAppQuery, {
21
+ appId,
22
+ });
23
+ return data.miniUnlinkApp;
24
+ };
25
+ //# sourceMappingURL=mini-unlink-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mini-unlink-app.js","sourceRoot":"","sources":["../../src/data/mini-unlink-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,mDAAmD,CAAA;AACzE,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAA;AAEtC,MAAM,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;CAehD,CAAC,CAAA;AAMF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,EAAC,KAAK,EAA0B,EAAE,EAAE;IACtE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE;QACpD,KAAK;KACN,CAAC,CAAA;IAEF,OAAO,IAAI,CAAC,aAAa,CAAA;AAC3B,CAAC,CAAA"}
@@ -0,0 +1,32 @@
1
+ import { AccountInfo, MinimalOrganizationApp, Organization, Paginateable } from './types.js';
2
+ export declare const token: () => Promise<string>;
3
+ export declare const CurrentAccountInfoQuery: string;
4
+ export declare const AllOrgsQuery: string;
5
+ export declare function fetchCurrentAccountInformation(): Promise<AccountInfo>;
6
+ export declare function fetchAllOrgs(): Promise<Organization[]>;
7
+ export declare const FindOrganizationQuery: string;
8
+ export interface FindOrganizationQueryVariables {
9
+ id: string;
10
+ title?: string;
11
+ }
12
+ export interface FindOrganizationQuerySchema {
13
+ organizations: {
14
+ nodes: {
15
+ id: string;
16
+ businessName: string;
17
+ apps: {
18
+ pageInfo: {
19
+ hasNextPage: boolean;
20
+ };
21
+ nodes: {
22
+ id: string;
23
+ title: string;
24
+ apiKey: string;
25
+ }[];
26
+ };
27
+ }[];
28
+ };
29
+ }
30
+ export declare const fetchAppsForOrg: (organizationId: string) => Promise<Paginateable<{
31
+ apps: MinimalOrganizationApp[];
32
+ }>>;
@@ -0,0 +1,123 @@
1
+ import { partnersRequest,
2
+ // partnersRequestDoc,
3
+ } from '@shopify/cli-kit/node/api/partners';
4
+ import { ensureAuthenticatedPartners } from '@shopify/cli-kit/node/session';
5
+ import { gql } from 'graphql-request';
6
+ import { OrganizationSource, } from './types.js';
7
+ let _session;
8
+ let _currentAccountInformation;
9
+ const session = async () => {
10
+ if (!_session) {
11
+ const { token, userId } = await ensureAuthenticatedPartners();
12
+ // eslint-disable-next-line require-atomic-updates
13
+ _session = {
14
+ token,
15
+ accountInfo: { type: 'UnknownAccount' },
16
+ userId,
17
+ };
18
+ const accountInfo = await fetchCurrentAccountInformation();
19
+ // eslint-disable-next-line require-atomic-updates
20
+ _session = { token, accountInfo, userId };
21
+ }
22
+ return _session;
23
+ };
24
+ export const token = async () => {
25
+ return (await session()).token;
26
+ };
27
+ const request = async (query, variables = undefined) => {
28
+ return partnersRequest(query, await token(), variables);
29
+ };
30
+ export const CurrentAccountInfoQuery = gql `
31
+ query currentAccountInfo {
32
+ currentAccountInfo {
33
+ __typename
34
+ ... on ServiceAccount {
35
+ orgName
36
+ }
37
+ ... on UserAccount {
38
+ email
39
+ }
40
+ }
41
+ }
42
+ `;
43
+ export const AllOrgsQuery = gql `
44
+ query AllOrgs {
45
+ organizations(first: 200) {
46
+ nodes {
47
+ __typename
48
+ id
49
+ businessName
50
+ }
51
+ __typename
52
+ }
53
+ }
54
+ `;
55
+ export async function fetchCurrentAccountInformation() {
56
+ const response = await request(CurrentAccountInfoQuery);
57
+ _currentAccountInformation = mapAccountInfo(response.currentAccountInfo);
58
+ return _currentAccountInformation;
59
+ }
60
+ export async function fetchAllOrgs() {
61
+ try {
62
+ const response = await request(AllOrgsQuery);
63
+ return response.organizations.nodes.map(org => ({
64
+ id: org.id,
65
+ businessName: org.businessName,
66
+ source: OrganizationSource.Partners,
67
+ }));
68
+ }
69
+ catch (error) {
70
+ if (error.statusCode === 404) {
71
+ return [];
72
+ }
73
+ else {
74
+ throw error;
75
+ }
76
+ }
77
+ }
78
+ export const FindOrganizationQuery = gql `
79
+ query FindOrganization($id: ID!, $title: String) {
80
+ organizations(id: $id, first: 1) {
81
+ nodes {
82
+ id
83
+ businessName
84
+ apps(first: 25, title: $title) {
85
+ pageInfo {
86
+ hasNextPage
87
+ }
88
+ nodes {
89
+ id
90
+ title
91
+ apiKey
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ `;
98
+ export const fetchAppsForOrg = async (organizationId) => {
99
+ const params = { id: organizationId };
100
+ const result = await request(FindOrganizationQuery, params);
101
+ return {
102
+ apps: result.organizations.nodes[0].apps.nodes,
103
+ hasMorePages: result.organizations.nodes[0].apps.pageInfo.hasNextPage,
104
+ };
105
+ };
106
+ function mapAccountInfo(accountInfo) {
107
+ if (accountInfo.__typename === 'UserAccount') {
108
+ return {
109
+ type: 'UserAccount',
110
+ email: accountInfo.email,
111
+ };
112
+ }
113
+ else if (accountInfo.__typename === 'ServiceAccount') {
114
+ return {
115
+ type: 'ServiceAccount',
116
+ orgName: accountInfo.orgName,
117
+ };
118
+ }
119
+ else {
120
+ return { type: 'UnknownAccount' };
121
+ }
122
+ }
123
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/data/partners/query.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe;AACf,wBAAwB;EACzB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAC,2BAA2B,EAAC,MAAM,+BAA+B,CAAA;AACzE,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,OAAO,EAOL,kBAAkB,GAGnB,MAAM,YAAY,CAA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,OAAO;SAC7B,CAAA;KACF;SAAM;QACL,OAAO,EAAC,IAAI,EAAE,gBAAgB,EAAC,CAAA;KAChC;AACH,CAAC"}
@@ -0,0 +1,55 @@
1
+ export type AccountInfo = UserAccountInfo | ServiceAccountInfo | UnknownAccountInfo;
2
+ export interface UserAccountInfo {
3
+ type: 'UserAccount';
4
+ email: string;
5
+ }
6
+ export interface ServiceAccountInfo {
7
+ type: 'ServiceAccount';
8
+ orgName: string;
9
+ }
10
+ export interface UnknownAccountInfo {
11
+ type: 'UnknownAccount';
12
+ }
13
+ export interface PartnersSession {
14
+ token: string;
15
+ accountInfo: AccountInfo;
16
+ userId: string;
17
+ }
18
+ export type AccountInfoSchema = {
19
+ __typename: 'UserAccount';
20
+ email: string;
21
+ } | {
22
+ __typename: 'ServiceAccount';
23
+ orgName: string;
24
+ };
25
+ export interface CurrentAccountInfoSchema {
26
+ currentAccountInfo: AccountInfoSchema;
27
+ }
28
+ export interface AllOrgsSchema {
29
+ organizations: {
30
+ nodes: {
31
+ __typename: string;
32
+ id: string;
33
+ businessName: string;
34
+ }[];
35
+ };
36
+ }
37
+ export declare enum OrganizationSource {
38
+ Partners = "Partners",
39
+ BusinessPlatform = "BusinessPlatform"
40
+ }
41
+ export interface Organization {
42
+ id: string;
43
+ businessName: string;
44
+ source?: OrganizationSource;
45
+ }
46
+ export type Paginateable<T> = T & {
47
+ hasMorePages: boolean;
48
+ };
49
+ export interface MinimalAppIdentifiers {
50
+ id: string;
51
+ apiKey: string;
52
+ }
53
+ export type MinimalOrganizationApp = MinimalAppIdentifiers & {
54
+ title: string;
55
+ };
@@ -0,0 +1,6 @@
1
+ export var OrganizationSource;
2
+ (function (OrganizationSource) {
3
+ OrganizationSource["Partners"] = "Partners";
4
+ OrganizationSource["BusinessPlatform"] = "BusinessPlatform";
5
+ })(OrganizationSource || (OrganizationSource = {}));
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/data/partners/types.ts"],"names":[],"mappings":"AAiDA,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,2CAAqB,CAAA;IACrB,2DAAqC,CAAA;AACvC,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B"}
@@ -27,9 +27,25 @@ declare const documents: {
27
27
  checksum: string;
28
28
  mimeType: string;
29
29
  }>>;
30
+ '\n query LinkedApps {\n mini {\n productionShopifyApp {\n id\n title\n }\n developmentShopifyApps {\n id\n title\n }\n }\n }\n': DocumentNode<types.LinkedAppsQuery, types.Exact<{
31
+ [key: string]: never;
32
+ }>>;
30
33
  '\n query Submissions($first: Int) {\n submissions(first: $first) {\n nodes {\n reference\n description\n status\n submittedAt\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n': DocumentNode<types.SubmissionsQuery, types.Exact<{
31
34
  first?: types.InputMaybe<number> | undefined;
32
35
  }>>;
36
+ '\n mutation MiniCreate(\n $name: String!\n $handle: String!\n $appApiKey: String!\n $partnersAccessToken: String!\n ) {\n miniCreate(\n name: $name\n handle: $handle\n appApiKey: $appApiKey\n partnersAccessToken: $partnersAccessToken\n ) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n token\n userErrors {\n code\n message\n field\n }\n }\n }\n': DocumentNode<types.MiniCreateMutation, types.Exact<{
37
+ name: string;
38
+ handle: string;
39
+ appApiKey: string;
40
+ partnersAccessToken: string;
41
+ }>>;
42
+ '\n mutation MiniLinkApp($appApiKey: String!, $partnersAccessToken: String!) {\n miniLinkApp(\n appApiKey: $appApiKey\n partnersAccessToken: $partnersAccessToken\n ) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': DocumentNode<types.MiniLinkAppMutation, types.Exact<{
43
+ appApiKey: string;
44
+ partnersAccessToken: string;
45
+ }>>;
46
+ '\n mutation MiniUnlinkApp($appId: ID!) {\n miniUnlinkApp(appId: $appId) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': DocumentNode<types.MiniUnlinkAppMutation, types.Exact<{
47
+ appId: string;
48
+ }>>;
33
49
  '\n query Mini {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n }\n': DocumentNode<types.MiniQuery, types.Exact<{
34
50
  [key: string]: never;
35
51
  }>>;
@@ -63,10 +79,26 @@ export declare function graphql(source: '\n mutation CreateSubmission($descript
63
79
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
64
80
  */
65
81
  export declare function graphql(source: '\n mutation CreateUpload(\n $filename: String!\n $fileSize: Int!\n $checksum: String!\n $mimeType: String!\n ) {\n submissionUploadCreate(\n input: {\n filename: $filename\n fileSize: $fileSize\n checksum: $checksum\n mimeType: $mimeType\n }\n ) {\n upload {\n url\n headers\n id\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'): (typeof documents)['\n mutation CreateUpload(\n $filename: String!\n $fileSize: Int!\n $checksum: String!\n $mimeType: String!\n ) {\n submissionUploadCreate(\n input: {\n filename: $filename\n fileSize: $fileSize\n checksum: $checksum\n mimeType: $mimeType\n }\n ) {\n upload {\n url\n headers\n id\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'];
82
+ /**
83
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
84
+ */
85
+ export declare function graphql(source: '\n query LinkedApps {\n mini {\n productionShopifyApp {\n id\n title\n }\n developmentShopifyApps {\n id\n title\n }\n }\n }\n'): (typeof documents)['\n query LinkedApps {\n mini {\n productionShopifyApp {\n id\n title\n }\n developmentShopifyApps {\n id\n title\n }\n }\n }\n'];
66
86
  /**
67
87
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
68
88
  */
69
89
  export declare function graphql(source: '\n query Submissions($first: Int) {\n submissions(first: $first) {\n nodes {\n reference\n description\n status\n submittedAt\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n'): (typeof documents)['\n query Submissions($first: Int) {\n submissions(first: $first) {\n nodes {\n reference\n description\n status\n submittedAt\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n'];
90
+ /**
91
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
92
+ */
93
+ export declare function graphql(source: '\n mutation MiniCreate(\n $name: String!\n $handle: String!\n $appApiKey: String!\n $partnersAccessToken: String!\n ) {\n miniCreate(\n name: $name\n handle: $handle\n appApiKey: $appApiKey\n partnersAccessToken: $partnersAccessToken\n ) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n token\n userErrors {\n code\n message\n field\n }\n }\n }\n'): (typeof documents)['\n mutation MiniCreate(\n $name: String!\n $handle: String!\n $appApiKey: String!\n $partnersAccessToken: String!\n ) {\n miniCreate(\n name: $name\n handle: $handle\n appApiKey: $appApiKey\n partnersAccessToken: $partnersAccessToken\n ) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n token\n userErrors {\n code\n message\n field\n }\n }\n }\n'];
94
+ /**
95
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
96
+ */
97
+ export declare function graphql(source: '\n mutation MiniLinkApp($appApiKey: String!, $partnersAccessToken: String!) {\n miniLinkApp(\n appApiKey: $appApiKey\n partnersAccessToken: $partnersAccessToken\n ) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'): (typeof documents)['\n mutation MiniLinkApp($appApiKey: String!, $partnersAccessToken: String!) {\n miniLinkApp(\n appApiKey: $appApiKey\n partnersAccessToken: $partnersAccessToken\n ) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'];
98
+ /**
99
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
100
+ */
101
+ export declare function graphql(source: '\n mutation MiniUnlinkApp($appId: ID!) {\n miniUnlinkApp(appId: $appId) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'): (typeof documents)['\n mutation MiniUnlinkApp($appId: ID!) {\n miniUnlinkApp(appId: $appId) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'];
70
102
  /**
71
103
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
72
104
  */
@@ -15,7 +15,11 @@ const documents = {
15
15
  '\n mutation CancelSubmission($reference: String!) {\n submissionCancel(reference: $reference) {\n submission {\n reference\n description\n status\n submittedAt\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': types.CancelSubmissionDocument,
16
16
  '\n mutation CreateSubmission($description: String!, $uploadId: ID!) {\n submissionCreate(description: $description, uploadId: $uploadId) {\n submission {\n reference\n description\n status\n submittedAt\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': types.CreateSubmissionDocument,
17
17
  '\n mutation CreateUpload(\n $filename: String!\n $fileSize: Int!\n $checksum: String!\n $mimeType: String!\n ) {\n submissionUploadCreate(\n input: {\n filename: $filename\n fileSize: $fileSize\n checksum: $checksum\n mimeType: $mimeType\n }\n ) {\n upload {\n url\n headers\n id\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': types.CreateUploadDocument,
18
+ '\n query LinkedApps {\n mini {\n productionShopifyApp {\n id\n title\n }\n developmentShopifyApps {\n id\n title\n }\n }\n }\n': types.LinkedAppsDocument,
18
19
  '\n query Submissions($first: Int) {\n submissions(first: $first) {\n nodes {\n reference\n description\n status\n submittedAt\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n': types.SubmissionsDocument,
20
+ '\n mutation MiniCreate(\n $name: String!\n $handle: String!\n $appApiKey: String!\n $partnersAccessToken: String!\n ) {\n miniCreate(\n name: $name\n handle: $handle\n appApiKey: $appApiKey\n partnersAccessToken: $partnersAccessToken\n ) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n token\n userErrors {\n code\n message\n field\n }\n }\n }\n': types.MiniCreateDocument,
21
+ '\n mutation MiniLinkApp($appApiKey: String!, $partnersAccessToken: String!) {\n miniLinkApp(\n appApiKey: $appApiKey\n partnersAccessToken: $partnersAccessToken\n ) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': types.MiniLinkAppDocument,
22
+ '\n mutation MiniUnlinkApp($appId: ID!) {\n miniUnlinkApp(appId: $appId) {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': types.MiniUnlinkAppDocument,
19
23
  '\n query Mini {\n mini {\n handle\n productionShopifyAppId\n developmentShopifyAppIds\n }\n }\n': types.MiniDocument,
20
24
  };
21
25
  export function graphql(source) {
@@ -1 +1 @@
1
- {"version":3,"file":"gql.js","sourceRoot":"","sources":["../../../../../src/data/types/autogenerated/shop-minis-admin-api/gql.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC;;;;;;;;;GASG;AACH,MAAM,SAAS,GAAG;IAChB,iHAAiH,EAC/G,KAAK,CAAC,wBAAwB;IAChC,wSAAwS,EACtS,KAAK,CAAC,wBAAwB;IAChC,mVAAmV,EACjV,KAAK,CAAC,wBAAwB;IAChC,+cAA+c,EAC7c,KAAK,CAAC,oBAAoB;IAC5B,4SAA4S,EAC1S,KAAK,CAAC,mBAAmB;IAC3B,wHAAwH,EACtH,KAAK,CAAC,YAAY;CACrB,CAAA;AAqDD,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,OAAQ,SAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;AACzC,CAAC"}
1
+ {"version":3,"file":"gql.js","sourceRoot":"","sources":["../../../../../src/data/types/autogenerated/shop-minis-admin-api/gql.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC;;;;;;;;;GASG;AACH,MAAM,SAAS,GAAG;IAChB,iHAAiH,EAC/G,KAAK,CAAC,wBAAwB;IAChC,wSAAwS,EACtS,KAAK,CAAC,wBAAwB;IAChC,mVAAmV,EACjV,KAAK,CAAC,wBAAwB;IAChC,+cAA+c,EAC7c,KAAK,CAAC,oBAAoB;IAC5B,wLAAwL,EACtL,KAAK,CAAC,kBAAkB;IAC1B,4SAA4S,EAC1S,KAAK,CAAC,mBAAmB;IAC3B,weAAwe,EACte,KAAK,CAAC,kBAAkB;IAC1B,2XAA2X,EACzX,KAAK,CAAC,mBAAmB;IAC3B,iRAAiR,EAC/Q,KAAK,CAAC,qBAAqB;IAC7B,wHAAwH,EACtH,KAAK,CAAC,YAAY;CACrB,CAAA;AA6ED,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,OAAQ,SAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;AACzC,CAAC"}