@shopify/cli-kit 3.0.25 → 3.0.26
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/CHANGELOG.md +15 -0
- package/assets/auth-error.html +2 -4
- package/assets/empty-url.html +2 -4
- package/assets/missing-code.html +2 -4
- package/assets/missing-state.html +2 -4
- package/assets/style.css +5 -8
- package/assets/success.html +1 -1
- package/dist/abort.d.ts +1 -0
- package/dist/abort.js +2 -0
- package/dist/abort.js.map +1 -0
- package/dist/analytics.d.ts +11 -0
- package/dist/analytics.js +96 -0
- package/dist/analytics.js.map +1 -0
- package/dist/api/admin.d.ts +3 -0
- package/dist/api/admin.js +80 -0
- package/dist/api/admin.js.map +1 -0
- package/dist/api/common.d.ts +11 -0
- package/dist/api/common.js +40 -0
- package/dist/api/common.js.map +1 -0
- package/dist/api/graphql/all_app_extension_registrations.d.ts +14 -0
- package/dist/api/graphql/all_app_extension_registrations.js +14 -0
- package/dist/api/graphql/all_app_extension_registrations.js.map +1 -0
- package/dist/api/graphql/all_orgs.d.ts +12 -0
- package/dist/api/graphql/all_orgs.js +14 -0
- package/dist/api/graphql/all_orgs.js.map +1 -0
- package/dist/api/graphql/all_stores_by_org.d.ts +18 -0
- package/dist/api/graphql/all_stores_by_org.js +21 -0
- package/dist/api/graphql/all_stores_by_org.js.map +1 -0
- package/dist/api/graphql/convert_dev_to_test_store.d.ts +16 -0
- package/dist/api/graphql/convert_dev_to_test_store.js +13 -0
- package/dist/api/graphql/convert_dev_to_test_store.js.map +1 -0
- package/dist/api/graphql/create_app.d.ts +28 -0
- package/dist/api/graphql/create_app.js +32 -0
- package/dist/api/graphql/create_app.js.map +1 -0
- package/dist/api/graphql/create_deployment.d.ts +33 -0
- package/dist/api/graphql/create_deployment.js +25 -0
- package/dist/api/graphql/create_deployment.js.map +1 -0
- package/dist/api/graphql/extension_create.d.ts +30 -0
- package/dist/api/graphql/extension_create.js +26 -0
- package/dist/api/graphql/extension_create.js.map +1 -0
- package/dist/api/graphql/extension_specifications.d.ts +18 -0
- package/dist/api/graphql/extension_specifications.js +18 -0
- package/dist/api/graphql/extension_specifications.js.map +1 -0
- package/dist/api/graphql/find_app.d.ts +13 -0
- package/dist/api/graphql/find_app.js +16 -0
- package/dist/api/graphql/find_app.js.map +1 -0
- package/dist/api/graphql/find_org.d.ts +23 -0
- package/dist/api/graphql/find_org.js +26 -0
- package/dist/api/graphql/find_org.js.map +1 -0
- package/dist/api/graphql/find_org_basic.d.ts +11 -0
- package/dist/api/graphql/find_org_basic.js +14 -0
- package/dist/api/graphql/find_org_basic.js.map +1 -0
- package/dist/api/graphql/functions/app_function_set.d.ts +43 -0
- package/dist/api/graphql/functions/app_function_set.js +52 -0
- package/dist/api/graphql/functions/app_function_set.js.map +1 -0
- package/dist/api/graphql/functions/compile_module.d.ts +15 -0
- package/dist/api/graphql/functions/compile_module.js +13 -0
- package/dist/api/graphql/functions/compile_module.js.map +1 -0
- package/dist/api/graphql/functions/function_service_proxy.d.ts +4 -0
- package/dist/api/graphql/functions/function_service_proxy.js +7 -0
- package/dist/api/graphql/functions/function_service_proxy.js.map +1 -0
- package/dist/api/graphql/functions/get_app_functions.d.ts +1 -0
- package/dist/api/graphql/functions/get_app_functions.js +10 -0
- package/dist/api/graphql/functions/get_app_functions.js.map +1 -0
- package/dist/api/graphql/functions/module_compilation_status.d.ts +15 -0
- package/dist/api/graphql/functions/module_compilation_status.js +13 -0
- package/dist/api/graphql/functions/module_compilation_status.js.map +1 -0
- package/dist/api/graphql/functions/module_upload_url_generate.d.ts +18 -0
- package/dist/api/graphql/functions/module_upload_url_generate.js +17 -0
- package/dist/api/graphql/functions/module_upload_url_generate.js.map +1 -0
- package/dist/api/graphql/generate_signed_upload_url.d.ts +15 -0
- package/dist/api/graphql/generate_signed_upload_url.js +15 -0
- package/dist/api/graphql/generate_signed_upload_url.js.map +1 -0
- package/dist/api/graphql/get_variant_id.d.ts +17 -0
- package/dist/api/graphql/get_variant_id.js +20 -0
- package/dist/api/graphql/get_variant_id.js.map +1 -0
- package/dist/api/graphql/index.d.ts +21 -0
- package/dist/api/graphql/index.js +22 -0
- package/dist/api/graphql/index.js.map +1 -0
- package/dist/api/graphql/update_draft.d.ts +33 -0
- package/dist/api/graphql/update_draft.js +24 -0
- package/dist/api/graphql/update_draft.js.map +1 -0
- package/dist/api/graphql/update_urls.d.ts +14 -0
- package/dist/api/graphql/update_urls.js +12 -0
- package/dist/api/graphql/update_urls.js.map +1 -0
- package/dist/api/identity.d.ts +1 -0
- package/dist/api/identity.js +29 -0
- package/dist/api/identity.js.map +1 -0
- package/dist/api/partners.d.ts +25 -0
- package/dist/api/partners.js +100 -0
- package/dist/api/partners.js.map +1 -0
- package/dist/api.d.ts +5 -0
- package/dist/api.js +6 -0
- package/dist/api.js.map +1 -0
- package/dist/checksum.d.ts +15 -0
- package/dist/checksum.js +27 -0
- package/dist/checksum.js.map +1 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.js +13 -0
- package/dist/cli.js.map +1 -0
- package/dist/colors.d.ts +1 -0
- package/dist/colors.js +8 -0
- package/dist/colors.js.map +1 -0
- package/dist/constants.d.ts +43 -0
- package/dist/constants.js +63 -0
- package/dist/constants.js.map +1 -0
- package/dist/dependency.d.ts +128 -0
- package/dist/dependency.js +302 -0
- package/dist/dependency.js.map +1 -0
- package/dist/dot-env.d.ts +28 -0
- package/dist/dot-env.js +31 -0
- package/dist/dot-env.js.map +1 -0
- package/dist/environment/fqdn.d.ts +23 -0
- package/dist/environment/fqdn.js +61 -0
- package/dist/environment/fqdn.js.map +1 -0
- package/dist/environment/local.d.ts +48 -0
- package/dist/environment/local.js +82 -0
- package/dist/environment/local.js.map +1 -0
- package/dist/environment/service.d.ts +17 -0
- package/dist/environment/service.js +41 -0
- package/dist/environment/service.js.map +1 -0
- package/dist/environment/spin.d.ts +47 -0
- package/dist/environment/spin.js +83 -0
- package/dist/environment/spin.js.map +1 -0
- package/dist/environment/utilities.d.ts +6 -0
- package/dist/environment/utilities.js +12 -0
- package/dist/environment/utilities.js.map +1 -0
- package/dist/environment.d.ts +5 -0
- package/dist/environment.js +6 -0
- package/dist/environment.js.map +1 -0
- package/dist/error.d.ts +44 -0
- package/dist/error.js +91 -0
- package/dist/error.js.map +1 -0
- package/dist/file.d.ts +67 -0
- package/dist/file.js +165 -0
- package/dist/file.js.map +1 -0
- package/dist/git.d.ts +15 -0
- package/dist/git.js +48 -0
- package/dist/git.js.map +1 -0
- package/dist/github.d.ts +33 -0
- package/dist/github.js +56 -0
- package/dist/github.js.map +1 -0
- package/dist/haiku.d.ts +1 -0
- package/dist/haiku.js +8 -0
- package/dist/haiku.js.map +1 -0
- package/dist/http/fetch.d.ts +16 -0
- package/dist/http/fetch.js +18 -0
- package/dist/http/fetch.js.map +1 -0
- package/dist/http/formdata.d.ts +3 -0
- package/dist/http/formdata.js +6 -0
- package/dist/http/formdata.js.map +1 -0
- package/dist/http.d.ts +2 -0
- package/dist/http.js +3 -0
- package/dist/http.js.map +1 -0
- package/dist/id.d.ts +6 -0
- package/dist/id.js +18 -0
- package/dist/id.js.map +1 -0
- package/dist/index.d.ts +37 -2179
- package/dist/index.js +38 -3264
- package/dist/index.js.map +1 -1
- package/dist/network/api.d.ts +2 -0
- package/dist/network/api.js +2 -0
- package/dist/network/api.js.map +1 -0
- package/dist/network/service.d.ts +16 -0
- package/dist/network/service.js +12 -0
- package/dist/network/service.js.map +1 -0
- package/dist/{archiver.d.ts → node/archiver.d.ts} +1 -4
- package/dist/node/archiver.js +22 -42
- package/dist/node/archiver.js.map +1 -1
- package/dist/node/cli.d.ts +18 -0
- package/dist/node/cli.js +91 -0
- package/dist/node/cli.js.map +1 -0
- package/dist/npm.d.ts +27 -0
- package/dist/npm.js +20 -0
- package/dist/npm.js.map +1 -0
- package/dist/os.d.ts +10 -0
- package/dist/os.js +70 -0
- package/dist/os.js.map +1 -0
- package/dist/output.d.ts +142 -0
- package/dist/output.js +505 -0
- package/dist/output.js.map +1 -0
- package/dist/path.d.ts +22 -0
- package/dist/path.js +43 -0
- package/dist/path.js.map +1 -0
- package/dist/plugins.d.ts +9 -0
- package/dist/plugins.js +12 -0
- package/dist/plugins.js.map +1 -0
- package/dist/port.d.ts +5 -0
- package/dist/port.js +13 -0
- package/dist/port.js.map +1 -0
- package/dist/ruby.d.ts +21 -0
- package/dist/ruby.js +192 -0
- package/dist/ruby.js.map +1 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.js +2 -0
- package/dist/schema.js.map +1 -0
- package/dist/secure-store.d.ts +19 -0
- package/dist/secure-store.js +63 -0
- package/dist/secure-store.js.map +1 -0
- package/dist/semver.d.ts +3 -0
- package/dist/semver.js +6 -0
- package/dist/semver.js.map +1 -0
- package/dist/session/authorize.d.ts +7 -0
- package/dist/session/authorize.js +40 -0
- package/dist/session/authorize.js.map +1 -0
- package/dist/session/exchange.d.ts +42 -0
- package/dist/session/exchange.js +144 -0
- package/dist/session/exchange.js.map +1 -0
- package/dist/session/identity.d.ts +3 -0
- package/dist/session/identity.js +58 -0
- package/dist/session/identity.js.map +1 -0
- package/dist/session/post-auth.d.ts +13 -0
- package/dist/session/post-auth.js +56 -0
- package/dist/session/post-auth.js.map +1 -0
- package/dist/session/redirect-listener.d.ts +34 -0
- package/dist/session/redirect-listener.js +97 -0
- package/dist/session/redirect-listener.js.map +1 -0
- package/dist/session/schema.d.ts +174 -0
- package/dist/session/schema.js +59 -0
- package/dist/session/schema.js.map +1 -0
- package/dist/session/scopes.d.ts +16 -0
- package/dist/session/scopes.js +53 -0
- package/dist/session/scopes.js.map +1 -0
- package/dist/session/store.d.ts +24 -0
- package/dist/session/store.js +88 -0
- package/dist/session/store.js.map +1 -0
- package/dist/session/token.d.ts +40 -0
- package/dist/session/token.js +22 -0
- package/dist/session/token.js.map +1 -0
- package/dist/session/validate.d.ts +17 -0
- package/dist/session/validate.js +75 -0
- package/dist/session/validate.js.map +1 -0
- package/dist/session.d.ts +88 -0
- package/dist/session.js +251 -0
- package/dist/session.js.map +1 -0
- package/dist/store/schema.d.ts +3 -0
- package/dist/store/schema.js +27 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store.d.ts +32 -0
- package/dist/store.js +102 -0
- package/dist/store.js.map +1 -0
- package/dist/string.d.ts +22 -0
- package/dist/string.js +38 -0
- package/dist/string.js.map +1 -0
- package/dist/system.d.ts +53 -0
- package/dist/system.js +109 -0
- package/dist/system.js.map +1 -0
- package/dist/template.d.ts +11 -0
- package/dist/template.js +50 -0
- package/dist/template.js.map +1 -0
- package/dist/testing/output.d.ts +9 -0
- package/dist/testing/output.js +15 -0
- package/dist/testing/output.js.map +1 -0
- package/dist/testing/store.d.ts +7 -0
- package/dist/testing/store.js +26 -0
- package/dist/testing/store.js.map +1 -0
- package/dist/toml.d.ts +3 -0
- package/dist/toml.js +8 -0
- package/dist/toml.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/ui/autocomplete.d.ts +7 -0
- package/dist/ui/autocomplete.js +43 -0
- package/dist/ui/autocomplete.js.map +1 -0
- package/dist/ui/input.d.ts +7 -0
- package/dist/ui/input.js +48 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/select.d.ts +6 -0
- package/dist/ui/select.js +30 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui.d.ts +36 -0
- package/dist/ui.js +124 -0
- package/dist/ui.js.map +1 -0
- package/dist/version.d.ts +19 -0
- package/dist/version.js +34 -0
- package/dist/version.js.map +1 -0
- package/dist/vscode.d.ts +8 -0
- package/dist/vscode.js +36 -0
- package/dist/vscode.js.map +1 -0
- package/dist/yaml.d.ts +2 -0
- package/dist/yaml.js +8 -0
- package/dist/yaml.js.map +1 -0
- package/package.json +14 -7
- package/dist/archiver.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/local-d0094ffe.js +0 -1344
- package/dist/local-d0094ffe.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './find_org.js';
|
|
2
|
+
export * from './all_orgs.js';
|
|
3
|
+
export * from './create_app.js';
|
|
4
|
+
export * from './update_urls.js';
|
|
5
|
+
export * from './find_app.js';
|
|
6
|
+
export * from './update_draft.js';
|
|
7
|
+
export * from './generate_signed_upload_url.js';
|
|
8
|
+
export * from './create_deployment.js';
|
|
9
|
+
export * from './all_stores_by_org.js';
|
|
10
|
+
export * from './convert_dev_to_test_store.js';
|
|
11
|
+
export * from './extension_create.js';
|
|
12
|
+
export * from './extension_specifications.js';
|
|
13
|
+
export * from './all_app_extension_registrations.js';
|
|
14
|
+
export * from './get_variant_id.js';
|
|
15
|
+
export * from './functions/function_service_proxy.js';
|
|
16
|
+
export * from './functions/get_app_functions.js';
|
|
17
|
+
export * from './functions/module_upload_url_generate.js';
|
|
18
|
+
export * from './functions/app_function_set.js';
|
|
19
|
+
export * from './functions/compile_module.js';
|
|
20
|
+
export * from './functions/module_compilation_status.js';
|
|
21
|
+
export * from './find_org_basic.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './find_org.js';
|
|
2
|
+
export * from './all_orgs.js';
|
|
3
|
+
export * from './create_app.js';
|
|
4
|
+
export * from './update_urls.js';
|
|
5
|
+
export * from './find_app.js';
|
|
6
|
+
export * from './update_draft.js';
|
|
7
|
+
export * from './generate_signed_upload_url.js';
|
|
8
|
+
export * from './create_deployment.js';
|
|
9
|
+
export * from './all_stores_by_org.js';
|
|
10
|
+
export * from './convert_dev_to_test_store.js';
|
|
11
|
+
export * from './extension_create.js';
|
|
12
|
+
export * from './extension_specifications.js';
|
|
13
|
+
export * from './all_app_extension_registrations.js';
|
|
14
|
+
export * from './get_variant_id.js';
|
|
15
|
+
export * from './functions/function_service_proxy.js';
|
|
16
|
+
export * from './functions/get_app_functions.js';
|
|
17
|
+
export * from './functions/module_upload_url_generate.js';
|
|
18
|
+
export * from './functions/app_function_set.js';
|
|
19
|
+
export * from './functions/compile_module.js';
|
|
20
|
+
export * from './functions/module_compilation_status.js';
|
|
21
|
+
export * from './find_org_basic.js';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/graphql/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,qBAAqB,CAAA;AACnC,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,2CAA2C,CAAA;AACzD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0CAA0C,CAAA;AACxD,cAAc,qBAAqB,CAAA","sourcesContent":["export * from './find_org.js'\nexport * from './all_orgs.js'\nexport * from './create_app.js'\nexport * from './update_urls.js'\nexport * from './find_app.js'\nexport * from './update_draft.js'\nexport * from './generate_signed_upload_url.js'\nexport * from './create_deployment.js'\nexport * from './all_stores_by_org.js'\nexport * from './convert_dev_to_test_store.js'\nexport * from './extension_create.js'\nexport * from './extension_specifications.js'\nexport * from './all_app_extension_registrations.js'\nexport * from './get_variant_id.js'\nexport * from './functions/function_service_proxy.js'\nexport * from './functions/get_app_functions.js'\nexport * from './functions/module_upload_url_generate.js'\nexport * from './functions/app_function_set.js'\nexport * from './functions/compile_module.js'\nexport * from './functions/module_compilation_status.js'\nexport * from './find_org_basic.js'\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const ExtensionUpdateDraftMutation: string;
|
|
2
|
+
export interface ExtensionUpdateDraftInput {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
config: string;
|
|
5
|
+
context: string | undefined;
|
|
6
|
+
registrationId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ExtensionUpdateDraftPayload {
|
|
9
|
+
clientMutationId: string;
|
|
10
|
+
extensionVersion: ExtensionVersion;
|
|
11
|
+
userErrors: {
|
|
12
|
+
field: string[];
|
|
13
|
+
message: string;
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
export interface ExtensionVersion {
|
|
17
|
+
config: string;
|
|
18
|
+
context: string;
|
|
19
|
+
id: string;
|
|
20
|
+
lastUserInteractionAt: string;
|
|
21
|
+
location: string;
|
|
22
|
+
registrationId: string;
|
|
23
|
+
registrationUuid: string;
|
|
24
|
+
uuid: string;
|
|
25
|
+
validationErrors: {
|
|
26
|
+
field: string[];
|
|
27
|
+
message: string;
|
|
28
|
+
}[];
|
|
29
|
+
versionTag: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ExtensionUpdateSchema {
|
|
32
|
+
extensionUpdateDraft: ExtensionUpdateDraftPayload;
|
|
33
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { gql } from 'graphql-request';
|
|
2
|
+
export const ExtensionUpdateDraftMutation = gql `
|
|
3
|
+
mutation ExtensionUpdateDraft($apiKey: String!, $registrationId: ID!, $config: JSON!, $context: String) {
|
|
4
|
+
extensionUpdateDraft(
|
|
5
|
+
input: {apiKey: $apiKey, registrationId: $registrationId, config: $config, context: $context}
|
|
6
|
+
) {
|
|
7
|
+
extensionVersion {
|
|
8
|
+
registrationId
|
|
9
|
+
context
|
|
10
|
+
lastUserInteractionAt
|
|
11
|
+
location
|
|
12
|
+
validationErrors {
|
|
13
|
+
field
|
|
14
|
+
message
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
userErrors {
|
|
18
|
+
field
|
|
19
|
+
message
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
//# sourceMappingURL=update_draft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_draft.js","sourceRoot":"","sources":["../../../src/api/graphql/update_draft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;CAqB9C,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const ExtensionUpdateDraftMutation = gql`\n mutation ExtensionUpdateDraft($apiKey: String!, $registrationId: ID!, $config: JSON!, $context: String) {\n extensionUpdateDraft(\n input: {apiKey: $apiKey, registrationId: $registrationId, config: $config, context: $context}\n ) {\n extensionVersion {\n registrationId\n context\n lastUserInteractionAt\n location\n validationErrors {\n field\n message\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n`\n\nexport interface ExtensionUpdateDraftInput {\n apiKey: string\n config: string\n // not all extensions require configs, e.g. subscription\n context: string | undefined\n registrationId: string\n}\n\n// \"\"\"\n// Autogenerated return type of ExtensionUpdateDraft\n// \"\"\"\nexport interface ExtensionUpdateDraftPayload {\n // \"\"\"\n // A unique identifier for the client performing the mutation.\n // \"\"\"\n clientMutationId: string\n extensionVersion: ExtensionVersion\n // userErrors: [UserError]\n userErrors: {\n field: string[]\n message: string\n }[]\n}\n\n// \"\"\"\n// A particular version of an extension belonging to a Shopify Partner App.\n// \"\"\"\nexport interface ExtensionVersion {\n // \"\"\"\n // The serialized JSON config for the extension version\n // \"\"\"\n config: string\n\n // \"\"\"\n // The context of an extension version, indicating where it will be rendered\n // \"\"\"\n context: string\n\n // \"\"\"\n // The unique identifier of the extension version\n // \"\"\"\n // id: ID\n id: string\n\n // \"\"\"\n // The last time a user updated an extension version\n // \"\"\"\n // lastUserInteractionAt: DateTime\n lastUserInteractionAt: string\n\n // \"\"\"\n // The URL to view the app extension version in the partners dashboard\n // \"\"\"\n // location: Url\n location: string\n\n // \"\"\"\n // The unique identifier of the extension registration this version belongs to\n // \"\"\"\n // registrationId: ID\n registrationId: string\n\n // \"\"\"\n // The uuid of the extension registration this version belongs to\n // \"\"\"\n registrationUuid: string\n\n // \"\"\"\n // The uuid of the extension version\n // \"\"\"\n uuid: string\n\n // \"\"\"\n // The validation errors for an extension version\n // \"\"\"\n // validationErrors: [ValidationError]\n validationErrors: {\n field: string[]\n message: string\n }[]\n\n // \"\"\"\n // The version tag of the extension version\n // \"\"\"\n versionTag: string\n}\n\nexport interface ExtensionUpdateSchema {\n extensionUpdateDraft: ExtensionUpdateDraftPayload\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const UpdateURLsQuery: string;
|
|
2
|
+
export interface UpdateURLsQueryVariables {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
appUrl: string;
|
|
5
|
+
redir: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface UpdateURLsQuerySchema {
|
|
8
|
+
appUpdate: {
|
|
9
|
+
userErrors: {
|
|
10
|
+
field: string[];
|
|
11
|
+
message: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { gql } from 'graphql-request';
|
|
2
|
+
export const UpdateURLsQuery = gql `
|
|
3
|
+
mutation appUpdate($apiKey: String!, $appUrl: Url!, $redir: [Url]!) {
|
|
4
|
+
appUpdate(input: {apiKey: $apiKey, applicationUrl: $appUrl, redirectUrlWhitelist: $redir}) {
|
|
5
|
+
userErrors {
|
|
6
|
+
message
|
|
7
|
+
field
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
//# sourceMappingURL=update_urls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_urls.js","sourceRoot":"","sources":["../../../src/api/graphql/update_urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;CASjC,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const UpdateURLsQuery = gql`\n mutation appUpdate($apiKey: String!, $appUrl: Url!, $redir: [Url]!) {\n appUpdate(input: {apiKey: $apiKey, applicationUrl: $appUrl, redirectUrlWhitelist: $redir}) {\n userErrors {\n message\n field\n }\n }\n }\n`\n\nexport interface UpdateURLsQueryVariables {\n apiKey: string\n appUrl: string\n redir: string[]\n}\n\nexport interface UpdateURLsQuerySchema {\n appUpdate: {\n userErrors: {\n field: string[]\n message: string\n }[]\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function validateIdentityToken(token: string): Promise<any>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { identity } from '../environment/fqdn.js';
|
|
2
|
+
import { debug } from '../output.js';
|
|
3
|
+
export async function validateIdentityToken(token) {
|
|
4
|
+
try {
|
|
5
|
+
const instrospectionURL = await getInstrospectionEndpoint();
|
|
6
|
+
const options = {
|
|
7
|
+
method: 'POST',
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
|
+
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
|
|
10
|
+
body: JSON.stringify({ token }),
|
|
11
|
+
};
|
|
12
|
+
debug(`Sending Identity Introspection request to URL: ${instrospectionURL}`);
|
|
13
|
+
const response = await fetch(instrospectionURL, options);
|
|
14
|
+
const json = await response.json();
|
|
15
|
+
debug(`The identity token is valid: ${json.valid}`);
|
|
16
|
+
return json.valid;
|
|
17
|
+
// eslint-disable-next-line no-catch-all/no-catch-all
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
debug(`The identity token is invalid: ${error}`);
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function getInstrospectionEndpoint() {
|
|
25
|
+
const response = await fetch(`https://${await identity()}/.well-known/openid-configuration.json`);
|
|
26
|
+
const json = await response.json();
|
|
27
|
+
return json.introspection_endpoint;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/api/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAA;AAElC,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,KAAa;IACvD,IAAI;QACF,MAAM,iBAAiB,GAAG,MAAM,yBAAyB,EAAE,CAAA;QAC3D,MAAM,OAAO,GAAG;YACd,MAAM,EAAE,MAAM;YACd,gEAAgE;YAChE,OAAO,EAAE,EAAC,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAC;YAC/E,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAC,KAAK,EAAC,CAAC;SAC9B,CAAA;QACD,KAAK,CAAC,kDAAkD,iBAAiB,EAAE,CAAC,CAAA;QAE5E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;QACxD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAElC,KAAK,CAAC,gCAAgC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QACnD,OAAO,IAAI,CAAC,KAAK,CAAA;QACjB,qDAAqD;KACtD;IAAC,OAAO,KAAK,EAAE;QACd,KAAK,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAA;QAChD,OAAO,KAAK,CAAA;KACb;AACH,CAAC;AAED,KAAK,UAAU,yBAAyB;IACtC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,MAAM,QAAQ,EAAE,wCAAwC,CAAC,CAAA;IACjG,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAClC,OAAO,IAAI,CAAC,sBAAsB,CAAA;AACpC,CAAC","sourcesContent":["import {identity} from '../environment/fqdn.js'\nimport {debug} from '../output.js'\n\nexport async function validateIdentityToken(token: string) {\n try {\n const instrospectionURL = await getInstrospectionEndpoint()\n const options = {\n method: 'POST',\n // eslint-disable-next-line @typescript-eslint/naming-convention\n headers: {Authorization: `Bearer ${token}`, 'Content-Type': 'application/json'},\n body: JSON.stringify({token}),\n }\n debug(`Sending Identity Introspection request to URL: ${instrospectionURL}`)\n\n const response = await fetch(instrospectionURL, options)\n const json = await response.json()\n\n debug(`The identity token is valid: ${json.valid}`)\n return json.valid\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (error) {\n debug(`The identity token is invalid: ${error}`)\n return false\n }\n}\n\nasync function getInstrospectionEndpoint(): Promise<string> {\n const response = await fetch(`https://${await identity()}/.well-known/openid-configuration.json`)\n const json = await response.json()\n return json.introspection_endpoint\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ExtendableError } from '../error.js';
|
|
2
|
+
import { Variables, RequestDocument } from 'graphql-request';
|
|
3
|
+
export declare class RequestClientError extends ExtendableError {
|
|
4
|
+
statusCode: number;
|
|
5
|
+
constructor(message: string, statusCode: number);
|
|
6
|
+
}
|
|
7
|
+
export declare function request<T>(query: RequestDocument, token: string, variables?: Variables): Promise<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Check if the given token is revoked and no longer valid to interact with the Partners API.
|
|
10
|
+
* @param token {string} - The token to check
|
|
11
|
+
* @returns {Promise<boolean>} - True if the token is revoked, false otherwise
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkIfTokenIsRevoked(token: string): Promise<boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* Function queries are proxied through the script service proxy.
|
|
16
|
+
* To execute a query, we encapsulate it inside another query (including the variables)
|
|
17
|
+
* This is done automatically, you just need to provide the query and the variables.
|
|
18
|
+
*
|
|
19
|
+
* @param apiKey {string} APIKey of the app where the query will be executed.
|
|
20
|
+
* @param query {any} GraphQL query to execute.
|
|
21
|
+
* @param token {string} Partners token
|
|
22
|
+
* @param variables {any} GraphQL variables to pass to the query.
|
|
23
|
+
* @returns {Promise<T>} The response of the query.
|
|
24
|
+
*/
|
|
25
|
+
export declare function functionProxyRequest<T>(apiKey: string, query: unknown, token: string, variables?: unknown): Promise<T>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { buildHeaders, sanitizedHeadersOutput } from './common.js';
|
|
2
|
+
import { ScriptServiceProxyQuery } from './graphql/index.js';
|
|
3
|
+
import { partners as partnersFqdn } from '../environment/fqdn.js';
|
|
4
|
+
import { debug, stringifyMessage, content, token as outputToken } from '../output.js';
|
|
5
|
+
import { ExtendableError } from '../error.js';
|
|
6
|
+
import { request as graphqlRequest, ClientError, gql } from 'graphql-request';
|
|
7
|
+
export class RequestClientError extends ExtendableError {
|
|
8
|
+
constructor(message, statusCode) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.statusCode = statusCode;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export async function request(query, token, variables) {
|
|
14
|
+
const fqdn = await partnersFqdn();
|
|
15
|
+
const url = `https://${fqdn}/api/cli/graphql`;
|
|
16
|
+
const headers = await buildHeaders(token);
|
|
17
|
+
debug(`
|
|
18
|
+
Sending Partners GraphQL request:
|
|
19
|
+
${query}
|
|
20
|
+
|
|
21
|
+
With variables:
|
|
22
|
+
${variables ? JSON.stringify(variables, null, 2) : ''}
|
|
23
|
+
|
|
24
|
+
And headers:
|
|
25
|
+
${sanitizedHeadersOutput(headers)}
|
|
26
|
+
`);
|
|
27
|
+
try {
|
|
28
|
+
const response = await graphqlRequest(url, query, variables, headers);
|
|
29
|
+
return response;
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (error instanceof ClientError) {
|
|
33
|
+
const errorMessage = stringifyMessage(content `
|
|
34
|
+
The Partners GraphQL API responded unsuccessfully with the HTTP status ${`${error.response.status}`} and errors:
|
|
35
|
+
|
|
36
|
+
${outputToken.json(error.response.errors)}
|
|
37
|
+
`);
|
|
38
|
+
const mappedError = new RequestClientError(errorMessage, error.response.status);
|
|
39
|
+
mappedError.stack = error.stack;
|
|
40
|
+
throw mappedError;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Check if the given token is revoked and no longer valid to interact with the Partners API.
|
|
49
|
+
* @param token {string} - The token to check
|
|
50
|
+
* @returns {Promise<boolean>} - True if the token is revoked, false otherwise
|
|
51
|
+
*/
|
|
52
|
+
export async function checkIfTokenIsRevoked(token) {
|
|
53
|
+
const query = gql `
|
|
54
|
+
{
|
|
55
|
+
organizations(first: 1) {
|
|
56
|
+
nodes {
|
|
57
|
+
id
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
const fqdn = await partnersFqdn();
|
|
63
|
+
const url = `https://${fqdn}/api/cli/graphql`;
|
|
64
|
+
const headers = await buildHeaders(token);
|
|
65
|
+
try {
|
|
66
|
+
await graphqlRequest(url, query, {}, headers);
|
|
67
|
+
return false;
|
|
68
|
+
// eslint-disable-next-line no-catch-all/no-catch-all
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
if (error instanceof ClientError) {
|
|
72
|
+
return error.response.status === 401;
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Function queries are proxied through the script service proxy.
|
|
79
|
+
* To execute a query, we encapsulate it inside another query (including the variables)
|
|
80
|
+
* This is done automatically, you just need to provide the query and the variables.
|
|
81
|
+
*
|
|
82
|
+
* @param apiKey {string} APIKey of the app where the query will be executed.
|
|
83
|
+
* @param query {any} GraphQL query to execute.
|
|
84
|
+
* @param token {string} Partners token
|
|
85
|
+
* @param variables {any} GraphQL variables to pass to the query.
|
|
86
|
+
* @returns {Promise<T>} The response of the query.
|
|
87
|
+
*/
|
|
88
|
+
export async function functionProxyRequest(apiKey, query, token, variables) {
|
|
89
|
+
const proxyVariables = {
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
91
|
+
api_key: apiKey,
|
|
92
|
+
query,
|
|
93
|
+
variables: JSON.stringify(variables) || '{}',
|
|
94
|
+
};
|
|
95
|
+
const proxyQuery = ScriptServiceProxyQuery;
|
|
96
|
+
const res = await request(proxyQuery, token, proxyVariables);
|
|
97
|
+
const json = JSON.parse(res.scriptServiceProxy);
|
|
98
|
+
return json;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=partners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partners.js","sourceRoot":"","sources":["../../src/api/partners.ts"],"names":[],"mappings":"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","sourcesContent":["import {buildHeaders, sanitizedHeadersOutput} from './common.js'\nimport {ScriptServiceProxyQuery} from './graphql/index.js'\nimport {partners as partnersFqdn} from '../environment/fqdn.js'\nimport {debug, stringifyMessage, content, token as outputToken} from '../output.js'\nimport {ExtendableError} from '../error.js'\nimport {request as graphqlRequest, Variables, RequestDocument, ClientError, gql} from 'graphql-request'\n\nexport class RequestClientError extends ExtendableError {\n statusCode: number\n public constructor(message: string, statusCode: number) {\n super(message)\n this.statusCode = statusCode\n }\n}\n\nexport async function request<T>(query: RequestDocument, token: string, variables?: Variables): Promise<T> {\n const fqdn = await partnersFqdn()\n const url = `https://${fqdn}/api/cli/graphql`\n const headers = await buildHeaders(token)\n debug(`\nSending Partners GraphQL request:\n${query}\n\nWith variables:\n${variables ? JSON.stringify(variables, null, 2) : ''}\n\nAnd headers:\n${sanitizedHeadersOutput(headers)}\n `)\n\n try {\n const response = await graphqlRequest<T>(url, query, variables, headers)\n return response\n } catch (error) {\n if (error instanceof ClientError) {\n const errorMessage = stringifyMessage(content`\nThe Partners GraphQL API responded unsuccessfully with the HTTP status ${`${error.response.status}`} and errors:\n\n${outputToken.json(error.response.errors)}\n `)\n const mappedError = new RequestClientError(errorMessage, error.response.status)\n mappedError.stack = error.stack\n throw mappedError\n } else {\n throw error\n }\n }\n}\n\n/**\n * Check if the given token is revoked and no longer valid to interact with the Partners API.\n * @param token {string} - The token to check\n * @returns {Promise<boolean>} - True if the token is revoked, false otherwise\n */\nexport async function checkIfTokenIsRevoked(token: string): Promise<boolean> {\n const query = gql`\n {\n organizations(first: 1) {\n nodes {\n id\n }\n }\n }\n `\n\n const fqdn = await partnersFqdn()\n const url = `https://${fqdn}/api/cli/graphql`\n const headers = await buildHeaders(token)\n\n try {\n await graphqlRequest(url, query, {}, headers)\n return false\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (error) {\n if (error instanceof ClientError) {\n return error.response.status === 401\n }\n return false\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 {string} APIKey of the app where the query will be executed.\n * @param query {any} GraphQL query to execute.\n * @param token {string} Partners token\n * @param variables {any} GraphQL variables to pass to the query.\n * @returns {Promise<T>} 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 // eslint-disable-next-line @typescript-eslint/naming-convention\n api_key: apiKey,\n query,\n variables: JSON.stringify(variables) || '{}',\n }\n const proxyQuery = ScriptServiceProxyQuery\n const res: ProxyResponse = await request(proxyQuery, token, proxyVariables)\n const json = JSON.parse(res.scriptServiceProxy)\n return json as T\n}\n"]}
|
package/dist/api.d.ts
ADDED
package/dist/api.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as admin from './api/admin.js';
|
|
2
|
+
import * as partners from './api/partners.js';
|
|
3
|
+
import * as graphql from './api/graphql/index.js';
|
|
4
|
+
import * as identity from './api/identity.js';
|
|
5
|
+
export { admin, partners, graphql, identity };
|
|
6
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAC,CAAA","sourcesContent":["import * as admin from './api/admin.js'\nimport * as partners from './api/partners.js'\nimport * as graphql from './api/graphql/index.js'\nimport * as identity from './api/identity.js'\n\nexport {admin, partners, graphql, identity}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Abort } from './error.js';
|
|
2
|
+
export declare const InvalidChecksumError: ({ file, expected, got }: {
|
|
3
|
+
file: string;
|
|
4
|
+
expected: string;
|
|
5
|
+
got: string;
|
|
6
|
+
}) => Abort;
|
|
7
|
+
/**
|
|
8
|
+
* Given a local file and a URL pointing to a remote file representing the MD5 of a local file,
|
|
9
|
+
* it validates the authenticity of the binary using an MD5 checksum.
|
|
10
|
+
* @param options: The file to validate and the URL that points to the file containing the MD5.
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateMD5({ file, md5FileURL }: {
|
|
13
|
+
file: string;
|
|
14
|
+
md5FileURL: string;
|
|
15
|
+
}): Promise<void>;
|
package/dist/checksum.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { fetch } from './http.js';
|
|
2
|
+
import { Abort } from './error.js';
|
|
3
|
+
import { debug, token } from './output.js';
|
|
4
|
+
import md5File from 'md5-file';
|
|
5
|
+
export const InvalidChecksumError = ({ file, expected, got }) => {
|
|
6
|
+
return new Abort(`The validation of ${file} failed. We expected the checksum ${expected}, but got ${got})`);
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Given a local file and a URL pointing to a remote file representing the MD5 of a local file,
|
|
10
|
+
* it validates the authenticity of the binary using an MD5 checksum.
|
|
11
|
+
* @param options: The file to validate and the URL that points to the file containing the MD5.
|
|
12
|
+
*/
|
|
13
|
+
export async function validateMD5({ file, md5FileURL }) {
|
|
14
|
+
debug(`Checking MD5 of file ${token.path(file)} against the MD5 in ${token.link('URL', md5FileURL)}`);
|
|
15
|
+
const md5Digest = await md5File(file);
|
|
16
|
+
const md5Response = await fetch(md5FileURL);
|
|
17
|
+
const md5Contents = await md5Response.text();
|
|
18
|
+
const canonicalMD5 = md5Contents.split(' ')[0];
|
|
19
|
+
if (!(canonicalMD5 === md5Digest)) {
|
|
20
|
+
throw InvalidChecksumError({
|
|
21
|
+
file,
|
|
22
|
+
got: md5Digest,
|
|
23
|
+
expected: canonicalMD5,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=checksum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checksum.js","sourceRoot":"","sources":["../src/checksum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAChC,OAAO,EAAC,KAAK,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACxC,OAAO,OAAO,MAAM,UAAU,CAAA;AAE9B,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAgD,EAAE,EAAE;IAC3G,OAAO,IAAI,KAAK,CAAC,qBAAqB,IAAI,qCAAqC,QAAQ,aAAa,GAAG,GAAG,CAAC,CAAA;AAC7G,CAAC,CAAA;AACD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAC,IAAI,EAAE,UAAU,EAAqC;IACtF,KAAK,CAAC,wBAAwB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,CAAA;IACrG,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,CAAA;IAC3C,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,CAAA;IAC5C,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9C,IAAI,CAAC,CAAC,YAAY,KAAK,SAAS,CAAC,EAAE;QACjC,MAAM,oBAAoB,CAAC;YACzB,IAAI;YACJ,GAAG,EAAE,SAAS;YACd,QAAQ,EAAE,YAAY;SACvB,CAAC,CAAA;KACH;AACH,CAAC","sourcesContent":["import {fetch} from './http.js'\nimport {Abort} from './error.js'\nimport {debug, token} from './output.js'\nimport md5File from 'md5-file'\n\nexport const InvalidChecksumError = ({file, expected, got}: {file: string; expected: string; got: string}) => {\n return new Abort(`The validation of ${file} failed. We expected the checksum ${expected}, but got ${got})`)\n}\n/**\n * Given a local file and a URL pointing to a remote file representing the MD5 of a local file,\n * it validates the authenticity of the binary using an MD5 checksum.\n * @param options: The file to validate and the URL that points to the file containing the MD5.\n */\nexport async function validateMD5({file, md5FileURL}: {file: string; md5FileURL: string}) {\n debug(`Checking MD5 of file ${token.path(file)} against the MD5 in ${token.link('URL', md5FileURL)}`)\n const md5Digest = await md5File(file)\n const md5Response = await fetch(md5FileURL)\n const md5Contents = await md5Response.text()\n const canonicalMD5 = md5Contents.split(' ')[0]\n if (!(canonicalMD5 === md5Digest)) {\n throw InvalidChecksumError({\n file,\n got: md5Digest,\n expected: canonicalMD5,\n })\n }\n}\n"]}
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* An object that contains the flags that
|
|
4
|
+
* are shared across all the commands.
|
|
5
|
+
*/
|
|
6
|
+
export const globalFlags = {
|
|
7
|
+
verbose: Flags.boolean({
|
|
8
|
+
hidden: false,
|
|
9
|
+
description: 'Increase the verbosity of the logs.',
|
|
10
|
+
env: 'SHOPIFY_FLAG_VERBOSE',
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC;;;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","sourcesContent":["import {Flags} from '@oclif/core'\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"]}
|
package/dist/colors.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const colors: any;
|
package/dist/colors.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
/**
|
|
3
|
+
* ansi-colors is a commonjs dependency that can be imported as a module.
|
|
4
|
+
* This file is a wrapper to require and export ansi-colors.
|
|
5
|
+
*/
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
export const colors = require('ansi-colors');
|
|
8
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,QAAQ,CAAA;AAEpC;;;GAGG;AACH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA","sourcesContent":["import {createRequire} from 'module'\n\n/**\n * ansi-colors is a commonjs dependency that can be imported as a module.\n * This file is a wrapper to require and export ansi-colors.\n */\nconst require = createRequire(import.meta.url)\nexport const colors = require('ansi-colors')\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const constants: {
|
|
2
|
+
environmentVariables: {
|
|
3
|
+
unitTest: string;
|
|
4
|
+
shopifyConfig: string;
|
|
5
|
+
runAsUser: string;
|
|
6
|
+
partnersEnv: string;
|
|
7
|
+
shopifyEnv: string;
|
|
8
|
+
identityEnv: string;
|
|
9
|
+
spin: string;
|
|
10
|
+
spinInstance: string;
|
|
11
|
+
spinWorkspace: string;
|
|
12
|
+
spinNamespace: string;
|
|
13
|
+
spinHost: string;
|
|
14
|
+
partnersToken: string;
|
|
15
|
+
verbose: string;
|
|
16
|
+
noAnalytics: string;
|
|
17
|
+
};
|
|
18
|
+
paths: {
|
|
19
|
+
executables: {
|
|
20
|
+
dev: string;
|
|
21
|
+
};
|
|
22
|
+
directories: {
|
|
23
|
+
cache: {
|
|
24
|
+
path: () => string;
|
|
25
|
+
vendor: {
|
|
26
|
+
path: () => string;
|
|
27
|
+
binaries: () => string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
versions: {
|
|
33
|
+
cliKit: () => Promise<string>;
|
|
34
|
+
};
|
|
35
|
+
keychain: {
|
|
36
|
+
service: string;
|
|
37
|
+
};
|
|
38
|
+
session: {
|
|
39
|
+
expirationTimeMarginInMinutes: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const bugsnagApiKey = "9e1e6889176fd0c795d5c659225e0fae";
|
|
43
|
+
export default constants;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import { join as pathJoin } from './path.js';
|
|
4
|
+
import { findPackageVersionUp } from './version.js';
|
|
5
|
+
import envPaths from 'env-paths';
|
|
6
|
+
const identifier = 'shopify-cli';
|
|
7
|
+
const cacheFolder = () => {
|
|
8
|
+
if (process.env.XDG_CACHE_HOME)
|
|
9
|
+
return process.env.XDG_CACHE_HOME;
|
|
10
|
+
return envPaths(identifier).cache;
|
|
11
|
+
};
|
|
12
|
+
const constants = {
|
|
13
|
+
environmentVariables: {
|
|
14
|
+
unitTest: 'SHOPIFY_UNIT_TEST',
|
|
15
|
+
shopifyConfig: 'SHOPIFY_CONFIG',
|
|
16
|
+
runAsUser: 'SHOPIFY_RUN_AS_USER',
|
|
17
|
+
partnersEnv: 'SHOPIFY_PARTNERS_ENV',
|
|
18
|
+
shopifyEnv: 'SHOPIFY_SHOPIFY_ENV',
|
|
19
|
+
identityEnv: 'SHOPIFY_IDENTITY_ENV',
|
|
20
|
+
spin: 'SPIN',
|
|
21
|
+
spinInstance: 'SPIN_INSTANCE',
|
|
22
|
+
spinWorkspace: 'SPIN_WORKSPACE',
|
|
23
|
+
spinNamespace: 'SPIN_NAMESPACE',
|
|
24
|
+
spinHost: 'SPIN_HOST',
|
|
25
|
+
partnersToken: 'SHOPIFY_CLI_PARTNERS_TOKEN',
|
|
26
|
+
verbose: 'SHOPIFY_FLAG_VERBOSE',
|
|
27
|
+
noAnalytics: 'SHOPIFY_CLI_NO_ANALYTICS',
|
|
28
|
+
},
|
|
29
|
+
paths: {
|
|
30
|
+
executables: {
|
|
31
|
+
dev: '/opt/dev/bin/dev',
|
|
32
|
+
},
|
|
33
|
+
directories: {
|
|
34
|
+
cache: {
|
|
35
|
+
path: () => {
|
|
36
|
+
return cacheFolder();
|
|
37
|
+
},
|
|
38
|
+
vendor: {
|
|
39
|
+
path: () => {
|
|
40
|
+
return pathJoin(cacheFolder(), 'vendor');
|
|
41
|
+
},
|
|
42
|
+
binaries: () => {
|
|
43
|
+
return pathJoin(cacheFolder(), 'vendor', 'binaries');
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
versions: {
|
|
50
|
+
cliKit: async () => {
|
|
51
|
+
return findPackageVersionUp({ fromModuleURL: import.meta.url });
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
keychain: {
|
|
55
|
+
service: 'shopify-cli',
|
|
56
|
+
},
|
|
57
|
+
session: {
|
|
58
|
+
expirationTimeMarginInMinutes: 4,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export const bugsnagApiKey = '9e1e6889176fd0c795d5c659225e0fae';
|
|
62
|
+
export default constants;
|
|
63
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,aAAa;AACb,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAC,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAA;AACjD,OAAO,QAAQ,MAAM,WAAW,CAAA;AAEhC,MAAM,UAAU,GAAG,aAAa,CAAA;AAEhC,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAA;IACjE,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,KAAK,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,SAAS,GAAG;IAChB,oBAAoB,EAAE;QACpB,QAAQ,EAAE,mBAAmB;QAC7B,aAAa,EAAE,gBAAgB;QAC/B,SAAS,EAAE,qBAAqB;QAChC,WAAW,EAAE,sBAAsB;QACnC,UAAU,EAAE,qBAAqB;QACjC,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,eAAe;QAC7B,aAAa,EAAE,gBAAgB;QAC/B,aAAa,EAAE,gBAAgB;QAC/B,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,4BAA4B;QAC3C,OAAO,EAAE,sBAAsB;QAC/B,WAAW,EAAE,0BAA0B;KACxC;IACD,KAAK,EAAE;QACL,WAAW,EAAE;YACX,GAAG,EAAE,kBAAkB;SACxB;QACD,WAAW,EAAE;YACX,KAAK,EAAE;gBACL,IAAI,EAAE,GAAG,EAAE;oBACT,OAAO,WAAW,EAAE,CAAA;gBACtB,CAAC;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,GAAG,EAAE;wBACT,OAAO,QAAQ,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,CAAA;oBAC1C,CAAC;oBACD,QAAQ,EAAE,GAAG,EAAE;wBACb,OAAO,QAAQ,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;oBACtD,CAAC;iBACF;aACF;SACF;KACF;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,KAAK,IAAI,EAAE;YACjB,OAAO,oBAAoB,CAAC,EAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAC,CAAC,CAAA;QAC/D,CAAC;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,aAAa;KACvB;IACD,OAAO,EAAE;QACP,6BAA6B,EAAE,CAAC;KACjC;CACF,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,kCAAkC,CAAA;AAE/D,eAAe,SAAS,CAAA","sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport {join as pathJoin} from './path.js'\nimport {findPackageVersionUp} from './version.js'\nimport envPaths from 'env-paths'\n\nconst identifier = 'shopify-cli'\n\nconst cacheFolder = () => {\n if (process.env.XDG_CACHE_HOME) return process.env.XDG_CACHE_HOME\n return envPaths(identifier).cache\n}\n\nconst constants = {\n environmentVariables: {\n unitTest: 'SHOPIFY_UNIT_TEST',\n shopifyConfig: 'SHOPIFY_CONFIG',\n runAsUser: 'SHOPIFY_RUN_AS_USER',\n partnersEnv: 'SHOPIFY_PARTNERS_ENV',\n shopifyEnv: 'SHOPIFY_SHOPIFY_ENV',\n identityEnv: 'SHOPIFY_IDENTITY_ENV',\n spin: 'SPIN',\n spinInstance: 'SPIN_INSTANCE',\n spinWorkspace: 'SPIN_WORKSPACE',\n spinNamespace: 'SPIN_NAMESPACE',\n spinHost: 'SPIN_HOST',\n partnersToken: 'SHOPIFY_CLI_PARTNERS_TOKEN',\n verbose: 'SHOPIFY_FLAG_VERBOSE',\n noAnalytics: 'SHOPIFY_CLI_NO_ANALYTICS',\n },\n paths: {\n executables: {\n dev: '/opt/dev/bin/dev',\n },\n directories: {\n cache: {\n path: () => {\n return cacheFolder()\n },\n vendor: {\n path: () => {\n return pathJoin(cacheFolder(), 'vendor')\n },\n binaries: () => {\n return pathJoin(cacheFolder(), 'vendor', 'binaries')\n },\n },\n },\n },\n },\n versions: {\n cliKit: async () => {\n return findPackageVersionUp({fromModuleURL: import.meta.url})\n },\n },\n keychain: {\n service: 'shopify-cli',\n },\n session: {\n expirationTimeMarginInMinutes: 4,\n },\n}\n\nexport const bugsnagApiKey = '9e1e6889176fd0c795d5c659225e0fae'\n\nexport default constants\n"]}
|