@shopify/shop-minis-cli 0.0.138 → 0.0.140
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/build/commands/app/index.d.ts +2 -0
- package/build/commands/app/index.js +14 -0
- package/build/commands/app/index.js.map +1 -0
- package/build/commands/app/link.d.ts +2 -0
- package/build/commands/app/link.js +55 -0
- package/build/commands/app/link.js.map +1 -0
- package/build/commands/app/list.d.ts +2 -0
- package/build/commands/app/list.js +37 -0
- package/build/commands/app/list.js.map +1 -0
- package/build/commands/app/unlink.d.ts +2 -0
- package/build/commands/app/unlink.js +47 -0
- package/build/commands/app/unlink.js.map +1 -0
- package/build/commands/codemod/releases/index.js +2 -0
- package/build/commands/codemod/releases/index.js.map +1 -1
- package/build/commands/codemod/releases/v0-0-139.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-139.js +26 -0
- package/build/commands/codemod/releases/v0-0-139.js.map +1 -0
- package/build/commands/create-mini/utils/template-app.js +1 -1
- package/build/commands/create-mini/utils/template-app.js.map +1 -1
- package/build/commands/dev/utils/cache-cleanup.d.ts +1 -0
- package/build/commands/dev/utils/cache-cleanup.js +45 -0
- package/build/commands/dev/utils/cache-cleanup.js.map +1 -0
- package/build/commands/dev/utils/interactive-terminal.d.ts +2 -1
- package/build/commands/dev/utils/interactive-terminal.js +12 -38
- package/build/commands/dev/utils/interactive-terminal.js.map +1 -1
- package/build/commands/dev/utils/simulator.js +4 -1
- package/build/commands/dev/utils/simulator.js.map +1 -1
- package/build/commands/setup/create.d.ts +2 -0
- package/build/commands/setup/create.js +77 -0
- package/build/commands/setup/create.js.map +1 -0
- package/build/commands/setup/index.js +2 -0
- package/build/commands/setup/index.js.map +1 -1
- package/build/data/get-linked-apps.d.ts +13 -0
- package/build/data/get-linked-apps.js +21 -0
- package/build/data/get-linked-apps.js.map +1 -0
- package/build/data/gql-client.js +6 -1
- package/build/data/gql-client.js.map +1 -1
- package/build/data/mini-create.d.ts +22 -0
- package/build/data/mini-create.js +39 -0
- package/build/data/mini-create.js.map +1 -0
- package/build/data/mini-link-app.d.ts +19 -0
- package/build/data/mini-link-app.js +29 -0
- package/build/data/mini-link-app.js.map +1 -0
- package/build/data/mini-unlink-app.d.ts +18 -0
- package/build/data/mini-unlink-app.js +25 -0
- package/build/data/mini-unlink-app.js.map +1 -0
- package/build/data/partners/query.d.ts +32 -0
- package/build/data/partners/query.js +123 -0
- package/build/data/partners/query.js.map +1 -0
- package/build/data/partners/types.d.ts +55 -0
- package/build/data/partners/types.js +6 -0
- package/build/data/partners/types.js.map +1 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/gql.d.ts +32 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/gql.js +4 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/gql.js.map +1 -1
- package/build/data/types/autogenerated/shop-minis-admin-api/graphql.d.ts +213 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js +365 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/schemas/manifest.schema.json +1 -7
- package/build/utils/package-manager.d.ts +2 -2
- package/build/utils/package-manager.js +4 -10
- package/build/utils/package-manager.js.map +1 -1
- package/build/utils/sync-manifest.d.ts +5 -0
- package/build/utils/sync-manifest.js +23 -0
- package/build/utils/sync-manifest.js.map +1 -0
- package/package.json +2 -2
- package/scripts/graphql-codegen.ts +8 -2
- package/build/commands/dev/utils/default-screen.d.ts +0 -2
- package/build/commands/dev/utils/default-screen.js +0 -171
- package/build/commands/dev/utils/default-screen.js.map +0 -1
- package/build/commands/open-default-screen/index.d.ts +0 -14
- package/build/commands/open-default-screen/index.js +0 -101
- package/build/commands/open-default-screen/index.js.map +0 -1
- package/build/commands/open-default-screen/utils/prompt-deeplink-host.d.ts +0 -6
- package/build/commands/open-default-screen/utils/prompt-deeplink-host.js +0 -33
- package/build/commands/open-default-screen/utils/prompt-deeplink-host.js.map +0 -1
|
@@ -8,6 +8,7 @@ import { SHOP_MINIS_ADMIN_API_KEY } from '../config.js';
|
|
|
8
8
|
import { acceptInvitation } from '../../data/accept-invitation.js';
|
|
9
9
|
import { getMiniBasePath } from '../../utils/path.js';
|
|
10
10
|
import { extractIdFromGID } from '../../utils/extract-id-gid.js';
|
|
11
|
+
import { command as createCommand } from './create.js';
|
|
11
12
|
function onCancel() {
|
|
12
13
|
console.log('\nCancelled setting up a new Shop Mini\n');
|
|
13
14
|
process.exit(0);
|
|
@@ -16,6 +17,7 @@ export function loadCommand(parentProgram) {
|
|
|
16
17
|
const command = new Command()
|
|
17
18
|
.name('setup')
|
|
18
19
|
.description('Set up a new Shop Mini')
|
|
20
|
+
.addCommand(createCommand, { hidden: true }) // TODO: remove hidden
|
|
19
21
|
.action(async () => {
|
|
20
22
|
const { confirmInvitationEmail } = await prompts.prompt({
|
|
21
23
|
type: 'confirm',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/setup/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAM,SAAS,CAAA;AAExB,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,OAAO,EAAC,wBAAwB,EAAC,MAAM,4CAA4C,CAAA;AACnF,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAC,wBAAwB,EAAC,MAAM,cAAc,CAAA;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAA;AAE9D,SAAS,QAAQ;IACf,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAA;IACvD,OAAO,CAAC,I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a,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;AACnC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const getLinkedApps: () => Promise<{
|
|
2
|
+
__typename?: "Mini" | undefined;
|
|
3
|
+
productionShopifyApp: {
|
|
4
|
+
__typename?: "ShopifyApp" | undefined;
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
};
|
|
8
|
+
developmentShopifyApps: {
|
|
9
|
+
__typename?: "ShopifyApp" | undefined;
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
}[];
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { graphql } from './types/autogenerated/shop-minis-admin-api/gql.js';
|
|
2
|
+
import { client } from './gql-client.js';
|
|
3
|
+
const getLinkedAppsQuery = graphql(/* GraphQL */ `
|
|
4
|
+
query LinkedApps {
|
|
5
|
+
mini {
|
|
6
|
+
productionShopifyApp {
|
|
7
|
+
id
|
|
8
|
+
title
|
|
9
|
+
}
|
|
10
|
+
developmentShopifyApps {
|
|
11
|
+
id
|
|
12
|
+
title
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`);
|
|
17
|
+
export const getLinkedApps = async () => {
|
|
18
|
+
const data = await client.request(getLinkedAppsQuery, {}, {});
|
|
19
|
+
return data.mini;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=get-linked-apps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-linked-apps.js","sourceRoot":"","sources":["../../src/data/get-linked-apps.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;;;;;;;;;;;;;CAahD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;IACtC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;IAE7D,OAAO,IAAI,CAAC,IAAK,CAAA;AACnB,CAAC,CAAA"}
|
package/build/data/gql-client.js
CHANGED
|
@@ -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,
|
|
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,CAAA;AAEnB,IAAI,QAAqC,CAAA;AACzC,IAAI,0BAAmD,CAAA;AAEvD,MAAM,OAAO,GAAG,KAAK,IAA8B,EAAE;IACnD,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,EAAC,KAAK,EAAE,MAAM,EAAC,GAAG,MAAM,2BAA2B,EAAE,CAAA;QAC3D,kDAAkD;QAClD,QAAQ,GAAG;YACT,KAAK;YACL,WAAW,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC;YACrC,MAAM;SACP,CAAA;QACD,MAAM,WAAW,GAAG,MAAM,8BAA8B,EAAE,CAAA;QAC1D,kDAAkD;QAClD,QAAQ,GAAG,EAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAC,CAAA;KACxC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,IAAqB,EAAE;IAC/C,OAAO,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAAA;AAChC,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,KAAK,EACnB,KAAa,EACb,YAA0C,SAAS,EACvC,EAAE;IACd,OAAO,eAAe,CAAC,KAAK,EAAE,MAAM,KAAK,EAAE,EAAE,SAAS,CAAC,CAAA;AACzD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW;KACtE,CAAA;AACH,CAAC,CAAA;AAED,SAAS,cAAc,CAAC,WAA8B;IACpD,IAAI,WAAW,CAAC,UAAU,KAAK,aAAa,EAAE;QAC5C,OAAO;YACL,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW,CAAC,KAAK;SACzB,CAAA;KACF;SAAM,IAAI,WAAW,CAAC,UAAU,KAAK,gBAAgB,EAAE;QACtD,OAAO;YACL,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,WAAW,CAAC,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 @@
|
|
|
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;
|
|
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"}
|