@stepzen/sdk 0.11.1 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client-v2.d.ts +33 -0
- package/lib/client-v2.js +71 -0
- package/lib/client-v2.js.map +1 -0
- package/lib/client.js +9 -9
- package/lib/client.js.map +1 -1
- package/lib/commands/account.js +2 -2
- package/lib/commands/account.js.map +1 -1
- package/lib/commands/authenticate.js +2 -2
- package/lib/commands/authenticate.js.map +1 -1
- package/lib/commands/deploy.js +2 -2
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/getPublicAccount.js +2 -2
- package/lib/commands/getPublicAccount.js.map +1 -1
- package/lib/commands/list.js +2 -2
- package/lib/commands/list.js.map +1 -1
- package/lib/commands/upload.js +8 -8
- package/lib/commands/upload.js.map +1 -1
- package/lib/commands-v2/account.d.ts +8 -0
- package/lib/commands-v2/account.js +61 -0
- package/lib/commands-v2/account.js.map +1 -0
- package/lib/commands-v2/deploy.d.ts +14 -0
- package/lib/commands-v2/deploy.js +96 -0
- package/lib/commands-v2/deploy.js.map +1 -0
- package/lib/commands-v2/getPublicAccount.d.ts +7 -0
- package/lib/commands-v2/getPublicAccount.js +38 -0
- package/lib/commands-v2/getPublicAccount.js.map +1 -0
- package/lib/commands-v2/list.d.ts +8 -0
- package/lib/commands-v2/list.js +66 -0
- package/lib/commands-v2/list.js.map +1 -0
- package/lib/index.d.ts +3 -33
- package/lib/index.js +5 -24
- package/lib/index.js.map +1 -1
- package/lib/init-v2.d.ts +35 -0
- package/lib/init-v2.js +40 -0
- package/lib/init-v2.js.map +1 -0
- package/lib/init.d.ts +34 -0
- package/lib/init.js +27 -0
- package/lib/init.js.map +1 -0
- package/lib/shared/graphql-client.d.ts +34 -0
- package/lib/shared/graphql-client.js +60 -0
- package/lib/shared/graphql-client.js.map +1 -0
- package/lib/shared/request.d.ts +3 -1
- package/lib/shared/request.js +3 -3
- package/lib/shared/request.js.map +1 -1
- package/lib/shared/transpiling.js +2 -2
- package/lib/shared/transpiling.js.map +1 -1
- package/lib/shared/types.d.ts +64 -0
- package/package.json +4 -4
- package/src/client-v2.ts +99 -0
- package/src/commands-v2/account.ts +89 -0
- package/src/commands-v2/deploy.ts +144 -0
- package/src/commands-v2/getPublicAccount.ts +59 -0
- package/src/commands-v2/list.ts +98 -0
- package/src/index.ts +3 -38
- package/src/init-v2.ts +70 -0
- package/src/init.ts +41 -0
- package/src/shared/graphql-client.ts +108 -0
- package/src/shared/request.ts +2 -2
- package/src/shared/transpiling.ts +1 -2
- package/src/shared/types.ts +77 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const graphql_client_1 = require("../shared/graphql-client");
|
|
5
|
+
exports.default = async ({ account, deploymentType, adminKey, sdkConfig, }) => {
|
|
6
|
+
const { data, errors } = await (0, graphql_client_1.fetchZenCtlGraphQLQuery)({
|
|
7
|
+
query: `query (
|
|
8
|
+
$account: String!
|
|
9
|
+
$deploymentType: String!
|
|
10
|
+
$adminKey: String!
|
|
11
|
+
) {
|
|
12
|
+
endpoints: endpointsForAccount(
|
|
13
|
+
account: $account
|
|
14
|
+
deploymentType: $deploymentType
|
|
15
|
+
adminkey: $adminKey
|
|
16
|
+
) {
|
|
17
|
+
endpointName: endpoint_name
|
|
18
|
+
folderName: folder_name
|
|
19
|
+
}
|
|
20
|
+
}`,
|
|
21
|
+
variables: {
|
|
22
|
+
account,
|
|
23
|
+
deploymentType,
|
|
24
|
+
adminKey,
|
|
25
|
+
},
|
|
26
|
+
sdkConfig,
|
|
27
|
+
});
|
|
28
|
+
if (errors) {
|
|
29
|
+
// strip graphql-specific error details, leave only the message
|
|
30
|
+
const message = errors
|
|
31
|
+
.map(({ message }) => {
|
|
32
|
+
let newMessage = message;
|
|
33
|
+
if (message.startsWith('ERROR: invalid input value for enum zenctl.deployment_type')) {
|
|
34
|
+
newMessage =
|
|
35
|
+
`Invalid deployment type: ${deploymentType}.` +
|
|
36
|
+
` Please check the 'deploymentType' parameter.`;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
message: newMessage,
|
|
40
|
+
};
|
|
41
|
+
})
|
|
42
|
+
.join('\n');
|
|
43
|
+
return {
|
|
44
|
+
data: undefined,
|
|
45
|
+
error: {
|
|
46
|
+
message,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const endpoints = data.endpoints.filter(Boolean);
|
|
51
|
+
if (!endpoints.length) {
|
|
52
|
+
return {
|
|
53
|
+
data: undefined,
|
|
54
|
+
error: {
|
|
55
|
+
message: 'Invalid credentials',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
data: endpoints.map(endpoint => (Object.assign(Object.assign({}, endpoint), { public: false, endpointType: 'dev', // TODO: implement
|
|
61
|
+
account,
|
|
62
|
+
deploymentType }))),
|
|
63
|
+
error: undefined,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands-v2/list.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAO9C,6DAAgE;AAEhE,kBAAe,KAAK,EAAE,EACpB,OAAO,EACP,cAAc,EACd,QAAQ,EACR,SAAS,GAMV,EAAkD,EAAE;IACnD,MAAM,EAAC,IAAI,EAAE,MAAM,EAAC,GAAG,MAAM,IAAA,wCAAuB,EAKjD;QACD,KAAK,EAAE;;;;;;;;;;;;;MAaL;QACF,SAAS,EAAE;YACT,OAAO;YACP,cAAc;YACd,QAAQ;SACT;QACD,SAAS;KACV,CAAC,CAAA;IAEF,IAAI,MAAM,EAAE;QACV,+DAA+D;QAC/D,MAAM,OAAO,GAAG,MAAM;aACnB,GAAG,CAAC,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE;YACjB,IAAI,UAAU,GAAG,OAAO,CAAA;YACxB,IACE,OAAO,CAAC,UAAU,CAChB,4DAA4D,CAC7D,EACD;gBACA,UAAU;oBACR,4BAA4B,cAAc,GAAG;wBAC7C,+CAA+C,CAAA;aAClD;YAED,OAAO;gBACL,OAAO,EAAE,UAAU;aACpB,CAAA;QACH,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAA;QAEb,OAAO;YACL,IAAI,EAAE,SAAS;YACf,KAAK,EAAE;gBACL,OAAO;aACR;SACF,CAAA;KACF;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAChD,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;QACrB,OAAO;YACL,IAAI,EAAE,SAAS;YACf,KAAK,EAAE;gBACL,OAAO,EAAE,qBAAqB;aAC/B;SACF,CAAA;KACF;IAED,OAAO;QACL,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,iCAC3B,QAAQ,KACX,MAAM,EAAE,KAAK,EACb,YAAY,EAAE,KAAK,EAAE,kBAAkB;YACvC,OAAO;YACP,cAAc,IACd,CAAC;QACH,KAAK,EAAE,SAAS;KACjB,CAAA;AACH,CAAC,CAAA"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,36 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
client: (options: UserCredentialsClientOptions | AnonymousClientOptions) => Promise<{
|
|
5
|
-
readonly credentials: {
|
|
6
|
-
account: string;
|
|
7
|
-
adminkey: string;
|
|
8
|
-
apikey: string;
|
|
9
|
-
};
|
|
10
|
-
account: () => Promise<{
|
|
11
|
-
account: string;
|
|
12
|
-
apikey: string;
|
|
13
|
-
} | {
|
|
14
|
-
success: false;
|
|
15
|
-
errors: string[];
|
|
16
|
-
}>;
|
|
17
|
-
deploy: (destination: string, properties: {
|
|
18
|
-
configurationsets?: string[] | undefined;
|
|
19
|
-
schema: string;
|
|
20
|
-
}) => Promise<import("./client").ZenCtlResponse>;
|
|
21
|
-
list: {
|
|
22
|
-
configurationsets: () => Promise<import("./client").ZenCtlResponse>;
|
|
23
|
-
schemas: () => Promise<import("./client").ZenCtlResponse>;
|
|
24
|
-
};
|
|
25
|
-
upload: {
|
|
26
|
-
configurationset: (destination: string, file: string) => Promise<import("./client").ZenCtlResponse>;
|
|
27
|
-
schema: (destination: string, directory: string) => Promise<import("./client").ZenCtlResponse>;
|
|
28
|
-
};
|
|
29
|
-
}>;
|
|
30
|
-
};
|
|
31
|
-
declare type PromisedType<T> = T extends Promise<infer U> ? U : T;
|
|
32
|
-
export declare type SDK = ReturnType<typeof init>;
|
|
33
|
-
export declare type SDKClient = PromisedType<ReturnType<SDK['client']>>;
|
|
1
|
+
import { SDK } from './init';
|
|
2
|
+
export * from './init';
|
|
3
|
+
export * from './init-v2';
|
|
34
4
|
/**
|
|
35
5
|
* The default SDK instance that does not know the name of the app using the SDK.
|
|
36
6
|
* It tries to guess the app name from `process.argv`
|
package/lib/index.js
CHANGED
|
@@ -1,37 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const defaults = {
|
|
10
|
-
domain: process.env.STEPZEN_DOMAIN || 'stepzen.io',
|
|
11
|
-
server: process.env.STEPZEN_SERVER_URL || 'https://{account}.stepzen.io',
|
|
12
|
-
};
|
|
13
|
-
return {
|
|
14
|
-
verify: (account, adminkey) => {
|
|
15
|
-
return authenticate_1.default({
|
|
16
|
-
account,
|
|
17
|
-
adminkey,
|
|
18
|
-
server: defaults.server.replace('{account}', account),
|
|
19
|
-
domain: defaults.domain,
|
|
20
|
-
}, sdkConfig);
|
|
21
|
-
},
|
|
22
|
-
client: async (options) => {
|
|
23
|
-
return client_1.createSdkClient(Object.assign(Object.assign({}, defaults), options), sdkConfig);
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
exports.init = init;
|
|
6
|
+
const init_1 = require("./init");
|
|
7
|
+
tslib_1.__exportStar(require("./init"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./init-v2"), exports);
|
|
28
9
|
/**
|
|
29
10
|
* The default SDK instance that does not know the name of the app using the SDK.
|
|
30
11
|
* It tries to guess the app name from `process.argv`
|
|
31
12
|
*
|
|
32
13
|
* @deprecated use the init({appName: 'my-app/1.2.3'}) method to initialis an SDK instance
|
|
33
14
|
*/
|
|
34
|
-
const stepzen =
|
|
15
|
+
const stepzen = (0, init_1.init)({
|
|
35
16
|
// For legacy apps use the script name (e.g. `index.js` as the app name)
|
|
36
17
|
// Fallback to `node` if this file is imported into an interactive node shell
|
|
37
18
|
appName: path.basename(process.argv[1] || process.argv[0]),
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,6BAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,6BAA4B;AAC5B,iCAAgC;AAEhC,iDAAsB;AACtB,oDAAyB;AAEzB;;;;;GAKG;AACH,MAAM,OAAO,GAAQ,IAAA,WAAI,EAAC;IACxB,wEAAwE;IACxE,6EAA6E;IAC7E,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CAC3D,CAAC,CAAA;AAEF,kBAAe,OAAO,CAAA;AAEtB,6EAA6E;AAC7E,kGAAkG;AAClG,iGAAiG;AACjG,uBAAuB;AACvB,MAAM,CAAC,OAAO,mCAAO,MAAM,CAAC,OAAO,GAAK,OAAO,CAAC,CAAA"}
|
package/lib/init-v2.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const initV2: (config: {
|
|
2
|
+
appName: string;
|
|
3
|
+
zenctlApiUrl?: string;
|
|
4
|
+
publicAccountApiUrl?: string;
|
|
5
|
+
}) => {
|
|
6
|
+
verify: (account: string, adminkey: string, deploymentType?: string) => Promise<boolean>;
|
|
7
|
+
client: (auth: {
|
|
8
|
+
account: string;
|
|
9
|
+
adminKey: string;
|
|
10
|
+
deploymentType?: string;
|
|
11
|
+
} | {
|
|
12
|
+
publicAccountToken: string;
|
|
13
|
+
deploymentType?: string;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
readonly credentials: {
|
|
16
|
+
account: string;
|
|
17
|
+
adminKey: string;
|
|
18
|
+
serviceKey: string;
|
|
19
|
+
deploymentType: string;
|
|
20
|
+
};
|
|
21
|
+
deploy: ({ endpointName, sdl, folderName, public: _public, endpointType, config, }: {
|
|
22
|
+
endpointName: string;
|
|
23
|
+
sdl: string;
|
|
24
|
+
folderName?: string | undefined;
|
|
25
|
+
public?: boolean | undefined;
|
|
26
|
+
endpointType?: string | undefined;
|
|
27
|
+
config?: string | undefined;
|
|
28
|
+
}) => Promise<import("./shared/types").ZenCtlResponseV2<import("./shared/types").StepZenEndpointV2>>;
|
|
29
|
+
list: () => Promise<import("./shared/types").ZenCtlResponseV2<import("./shared/types").StepZenEndpointV2[]>>;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
declare type PromisedType<T> = T extends Promise<infer U> ? U : T;
|
|
33
|
+
export declare type SDKV2 = ReturnType<typeof initV2>;
|
|
34
|
+
export declare type SDKClientV2 = PromisedType<ReturnType<SDKV2['client']>>;
|
|
35
|
+
export {};
|
package/lib/init-v2.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.initV2 = void 0;
|
|
5
|
+
const account_1 = require("./commands-v2/account");
|
|
6
|
+
const client_v2_1 = require("./client-v2");
|
|
7
|
+
const initV2 = (config) => {
|
|
8
|
+
var _a;
|
|
9
|
+
const defaults = {
|
|
10
|
+
zenctlApiUrl: process.env.STEPZEN_ZENCTL_API_URL ||
|
|
11
|
+
'https://braselton.stepzen.net/api/zenctl2/__graphql',
|
|
12
|
+
publicAccountApiUrl: process.env.STEPZEN_PUBLIC_ACCOUNT_API_URL ||
|
|
13
|
+
'https://stepzen.stepzen.net/api/publicaccount/__graphql',
|
|
14
|
+
deploymentType: process.env.STEPZEN_DEPLOYMENT_TYPE ||
|
|
15
|
+
((_a = process.env.STEPZEN_DOMAIN) === null || _a === void 0 ? void 0 : _a.replace('.io', '')) ||
|
|
16
|
+
'steprz',
|
|
17
|
+
};
|
|
18
|
+
const sdkConfig = Object.assign({ apiVersion: 'v2', zenctlApiUrl: defaults.zenctlApiUrl, publicAccountApiUrl: defaults.publicAccountApiUrl }, config);
|
|
19
|
+
return {
|
|
20
|
+
verify: async (account, adminkey, deploymentType = defaults.deploymentType) => {
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await (0, account_1.default)({
|
|
23
|
+
account,
|
|
24
|
+
adminKey: adminkey,
|
|
25
|
+
deploymentType,
|
|
26
|
+
sdkConfig,
|
|
27
|
+
});
|
|
28
|
+
return Boolean(data === null || data === void 0 ? void 0 : data.length);
|
|
29
|
+
}
|
|
30
|
+
catch (_a) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
client: async (auth) => {
|
|
35
|
+
return (0, client_v2_1.createSdkClient)(Object.assign({ deploymentType: defaults.deploymentType }, auth), sdkConfig);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
exports.initV2 = initV2;
|
|
40
|
+
//# sourceMappingURL=init-v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-v2.js","sourceRoot":"","sources":["../src/init-v2.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,mDAAkD;AAClD,2CAA2C;AAGpC,MAAM,MAAM,GAAG,CAAC,MAItB,EAAE,EAAE;;IACH,MAAM,QAAQ,GAAG;QACf,YAAY,EACV,OAAO,CAAC,GAAG,CAAC,sBAAsB;YAClC,qDAAqD;QACvD,mBAAmB,EACjB,OAAO,CAAC,GAAG,CAAC,8BAA8B;YAC1C,yDAAyD;QAC3D,cAAc,EACZ,OAAO,CAAC,GAAG,CAAC,uBAAuB;aACnC,MAAA,OAAO,CAAC,GAAG,CAAC,cAAc,0CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YAC9C,QAAQ;KACX,CAAA;IAED,MAAM,SAAS,mBACb,UAAU,EAAE,IAAI,EAChB,YAAY,EAAE,QAAQ,CAAC,YAAY,EACnC,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB,IAC9C,MAAM,CACV,CAAA;IAED,OAAO;QACL,MAAM,EAAE,KAAK,EACX,OAAe,EACf,QAAgB,EAChB,iBAAyB,QAAQ,CAAC,cAAc,EAChD,EAAE;YACF,IAAI;gBACF,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAA,iBAAc,EAAC;oBAClC,OAAO;oBACP,QAAQ,EAAE,QAAQ;oBAClB,cAAc;oBACd,SAAS;iBACV,CAAC,CAAA;gBACF,OAAO,OAAO,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAC,CAAA;aAC7B;YAAC,WAAM;gBACN,OAAO,KAAK,CAAA;aACb;QACH,CAAC;QACD,MAAM,EAAE,KAAK,EACX,IAEyD,EACzD,EAAE;YACF,OAAO,IAAA,2BAAe,kBAElB,cAAc,EAAE,QAAQ,CAAC,cAAc,IACpC,IAAI,GAET,SAAS,CACV,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA;AAzDY,QAAA,MAAM,UAyDlB"}
|
package/lib/init.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AnonymousClientOptions, SDKConfiguration, UserCredentialsClientOptions } from './shared/types';
|
|
2
|
+
export declare const init: (sdkConfig: SDKConfiguration) => {
|
|
3
|
+
verify: (account: string, adminkey: string) => Promise<boolean>;
|
|
4
|
+
client: (options: UserCredentialsClientOptions | AnonymousClientOptions) => Promise<{
|
|
5
|
+
readonly credentials: {
|
|
6
|
+
account: string;
|
|
7
|
+
adminkey: string;
|
|
8
|
+
apikey: string;
|
|
9
|
+
};
|
|
10
|
+
account: () => Promise<{
|
|
11
|
+
account: string;
|
|
12
|
+
apikey: string;
|
|
13
|
+
} | {
|
|
14
|
+
success: false;
|
|
15
|
+
errors: string[];
|
|
16
|
+
}>;
|
|
17
|
+
deploy: (destination: string, properties: {
|
|
18
|
+
configurationsets?: string[] | undefined;
|
|
19
|
+
schema: string;
|
|
20
|
+
}) => Promise<import("./client").ZenCtlResponse>;
|
|
21
|
+
list: {
|
|
22
|
+
configurationsets: () => Promise<import("./client").ZenCtlResponse>;
|
|
23
|
+
schemas: () => Promise<import("./client").ZenCtlResponse>;
|
|
24
|
+
};
|
|
25
|
+
upload: {
|
|
26
|
+
configurationset: (destination: string, file: string) => Promise<import("./client").ZenCtlResponse>;
|
|
27
|
+
schema: (destination: string, directory: string) => Promise<import("./client").ZenCtlResponse>;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
declare type PromisedType<T> = T extends Promise<infer U> ? U : T;
|
|
32
|
+
export declare type SDK = ReturnType<typeof init>;
|
|
33
|
+
export declare type SDKClient = PromisedType<ReturnType<SDK['client']>>;
|
|
34
|
+
export {};
|
package/lib/init.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.init = void 0;
|
|
5
|
+
const authenticate_1 = require("./commands/authenticate");
|
|
6
|
+
const client_1 = require("./client");
|
|
7
|
+
const init = (sdkConfig) => {
|
|
8
|
+
const defaults = {
|
|
9
|
+
domain: process.env.STEPZEN_DOMAIN || 'stepzen.io',
|
|
10
|
+
server: process.env.STEPZEN_SERVER_URL || 'https://{account}.stepzen.io',
|
|
11
|
+
};
|
|
12
|
+
return {
|
|
13
|
+
verify: (account, adminkey) => {
|
|
14
|
+
return (0, authenticate_1.default)({
|
|
15
|
+
account,
|
|
16
|
+
adminkey,
|
|
17
|
+
server: defaults.server.replace('{account}', account),
|
|
18
|
+
domain: defaults.domain,
|
|
19
|
+
}, sdkConfig);
|
|
20
|
+
},
|
|
21
|
+
client: async (options) => {
|
|
22
|
+
return (0, client_1.createSdkClient)(Object.assign(Object.assign({}, defaults), options), sdkConfig);
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.init = init;
|
|
27
|
+
//# sourceMappingURL=init.js.map
|
package/lib/init.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,0DAAkD;AAClD,qCAAwC;AAOjC,MAAM,IAAI,GAAG,CAAC,SAA2B,EAAE,EAAE;IAClD,MAAM,QAAQ,GAAG;QACf,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,YAAY;QAClD,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,8BAA8B;KACzE,CAAA;IAED,OAAO;QACL,MAAM,EAAE,CAAC,OAAe,EAAE,QAAgB,EAAE,EAAE;YAC5C,OAAO,IAAA,sBAAY,EACjB;gBACE,OAAO;gBACP,QAAQ;gBACR,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC;gBACrD,MAAM,EAAE,QAAQ,CAAC,MAAM;aACxB,EACD,SAAS,CACV,CAAA;QACH,CAAC;QACD,MAAM,EAAE,KAAK,EACX,OAA8D,EAC9D,EAAE;YACF,OAAO,IAAA,wBAAe,kCAAK,QAAQ,GAAK,OAAO,GAAG,SAAS,CAAC,CAAA;QAC9D,CAAC;KACF,CAAA;AACH,CAAC,CAAA;AAxBY,QAAA,IAAI,QAwBhB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SDKConfigurationV2 } from './types';
|
|
2
|
+
export declare type GraphQLSuccessResponse<T> = {
|
|
3
|
+
data: T;
|
|
4
|
+
errors: undefined;
|
|
5
|
+
};
|
|
6
|
+
export declare type GraphQLErrorResponse<T> = {
|
|
7
|
+
data: T | null;
|
|
8
|
+
errors: Array<{
|
|
9
|
+
message: string;
|
|
10
|
+
locations?: Array<{
|
|
11
|
+
line: number;
|
|
12
|
+
column: number;
|
|
13
|
+
}>;
|
|
14
|
+
path?: Array<string | number>;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
export declare type GraphQLResponse<T> = GraphQLSuccessResponse<T> | GraphQLErrorResponse<T>;
|
|
18
|
+
export declare const fetchGraphQLQuery: <T>({ url, query, variables, headers, }: {
|
|
19
|
+
url: URL | string;
|
|
20
|
+
query: string;
|
|
21
|
+
variables: Record<string, any>;
|
|
22
|
+
headers: Record<string, any>;
|
|
23
|
+
}) => Promise<GraphQLResponse<T>>;
|
|
24
|
+
export declare const fetchZenCtlGraphQLQuery: <T>({ query, variables, sdkConfig, }: {
|
|
25
|
+
query: string;
|
|
26
|
+
variables: Record<string, any>;
|
|
27
|
+
sdkConfig: SDKConfigurationV2;
|
|
28
|
+
}) => Promise<GraphQLResponse<T>>;
|
|
29
|
+
export declare const fetchPublicAccountGraphQLQuery: <T>({ url, query, variables, sdkConfig, }: {
|
|
30
|
+
url: URL | string;
|
|
31
|
+
query: string;
|
|
32
|
+
variables: Record<string, any>;
|
|
33
|
+
sdkConfig: SDKConfigurationV2;
|
|
34
|
+
}) => Promise<GraphQLResponse<T>>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.fetchPublicAccountGraphQLQuery = exports.fetchZenCtlGraphQLQuery = exports.fetchGraphQLQuery = void 0;
|
|
5
|
+
const debug = require("debug");
|
|
6
|
+
const node_fetch_1 = require("node-fetch");
|
|
7
|
+
const request_1 = require("./request");
|
|
8
|
+
const fetchGraphQLQuery = async ({ url, query, variables = {}, headers = {}, }) => {
|
|
9
|
+
debug('stepzen:sdk:url')(url);
|
|
10
|
+
debug('stepzen:sdk:headers')(headers);
|
|
11
|
+
debug('stepzen:sdk:query')(query);
|
|
12
|
+
debug('stepzen:sdk:variables')(variables);
|
|
13
|
+
try {
|
|
14
|
+
const response = await (0, node_fetch_1.default)(url, {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
headers: Object.assign({ 'content-type': 'application/json' }, headers),
|
|
17
|
+
body: JSON.stringify({
|
|
18
|
+
query,
|
|
19
|
+
variables,
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
22
|
+
const json = await response.json();
|
|
23
|
+
debug('stepzen:sdk:response')(json);
|
|
24
|
+
const { data, errors } = json;
|
|
25
|
+
if (errors) {
|
|
26
|
+
return { data, errors };
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return { data, errors: undefined };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
debug('stepzen:sdk:response')(`Failed to fetch from a GraphQL API`, error);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.fetchGraphQLQuery = fetchGraphQLQuery;
|
|
38
|
+
const fetchZenCtlGraphQLQuery = async ({ query, variables = {}, sdkConfig, }) => {
|
|
39
|
+
return (0, exports.fetchGraphQLQuery)({
|
|
40
|
+
url: sdkConfig.zenctlApiUrl,
|
|
41
|
+
query,
|
|
42
|
+
variables,
|
|
43
|
+
headers: {
|
|
44
|
+
'user-agent': (0, request_1.getUserAgent)(sdkConfig),
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.fetchZenCtlGraphQLQuery = fetchZenCtlGraphQLQuery;
|
|
49
|
+
const fetchPublicAccountGraphQLQuery = async ({ url, query, variables = {}, sdkConfig, }) => {
|
|
50
|
+
return (0, exports.fetchGraphQLQuery)({
|
|
51
|
+
url,
|
|
52
|
+
query,
|
|
53
|
+
variables,
|
|
54
|
+
headers: {
|
|
55
|
+
'user-agent': (0, request_1.getUserAgent)(sdkConfig),
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
exports.fetchPublicAccountGraphQLQuery = fetchPublicAccountGraphQLQuery;
|
|
60
|
+
//# sourceMappingURL=graphql-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-client.js","sourceRoot":"","sources":["../../src/shared/graphql-client.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,+BAA8B;AAC9B,2CAA8B;AAG9B,uCAAsC;AAoB/B,MAAM,iBAAiB,GAAG,KAAK,EAAK,EACzC,GAAG,EACH,KAAK,EACL,SAAS,GAAG,EAAE,EACd,OAAO,GAAG,EAAE,GAMb,EAA+B,EAAE;IAChC,KAAK,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAA;IAC7B,KAAK,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAA;IACrC,KAAK,CAAC,mBAAmB,CAAC,CAAC,KAAK,CAAC,CAAA;IACjC,KAAK,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,CAAA;IAEzC,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAK,EAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,OAAO,kBACL,cAAc,EAAE,kBAAkB,IAC/B,OAAO,CACX;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,KAAK;gBACL,SAAS;aACV,CAAC;SACH,CAAC,CAAA;QACF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAClC,KAAK,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,CAAA;QAEnC,MAAM,EAAC,IAAI,EAAE,MAAM,EAAC,GAAG,IAAI,CAAA;QAC3B,IAAI,MAAM,EAAE;YACV,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,CAAA;SACtB;aAAM;YACL,OAAO,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAC,CAAA;SACjC;KACF;IAAC,OAAO,KAAK,EAAE;QACd,KAAK,CAAC,sBAAsB,CAAC,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAA;QAC1E,MAAM,KAAK,CAAA;KACZ;AACH,CAAC,CAAA;AAzCY,QAAA,iBAAiB,qBAyC7B;AAEM,MAAM,uBAAuB,GAAG,KAAK,EAAK,EAC/C,KAAK,EACL,SAAS,GAAG,EAAE,EACd,SAAS,GAKV,EAA+B,EAAE;IAChC,OAAO,IAAA,yBAAiB,EAAC;QACvB,GAAG,EAAE,SAAS,CAAC,YAAY;QAC3B,KAAK;QACL,SAAS;QACT,OAAO,EAAE;YACP,YAAY,EAAE,IAAA,sBAAY,EAAC,SAAS,CAAC;SACtC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAjBY,QAAA,uBAAuB,2BAiBnC;AAEM,MAAM,8BAA8B,GAAG,KAAK,EAAK,EACtD,GAAG,EACH,KAAK,EACL,SAAS,GAAG,EAAE,EACd,SAAS,GAMV,EAA+B,EAAE;IAChC,OAAO,IAAA,yBAAiB,EAAC;QACvB,GAAG;QACH,KAAK;QACL,SAAS;QACT,OAAO,EAAE;YACP,YAAY,EAAE,IAAA,sBAAY,EAAC,SAAS,CAAC;SACtC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAnBY,QAAA,8BAA8B,kCAmB1C"}
|
package/lib/shared/request.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { SDKConfiguration, StepZenAccount, ZenCtlRequestHeaders } from './types';
|
|
2
|
-
export declare const getUserAgent: (
|
|
2
|
+
export declare const getUserAgent: ({ appName }: {
|
|
3
|
+
appName: string;
|
|
4
|
+
}) => string;
|
|
3
5
|
export declare const getRequestHeaders: (account: StepZenAccount, sdkConfig: SDKConfiguration) => ZenCtlRequestHeaders;
|
package/lib/shared/request.js
CHANGED
|
@@ -9,8 +9,8 @@ const { version } = require('../../package.json');
|
|
|
9
9
|
// https://github.com/oclif/core/blob/d7067d13c7d80c9e0064455c27ac1ebb6ee53fd2/src/config/config.ts#L128
|
|
10
10
|
const arch = os.arch() === 'ia32' ? 'x86' : os.arch();
|
|
11
11
|
const platform = isWsl ? 'wsl' : os.platform();
|
|
12
|
-
const getUserAgent = (
|
|
13
|
-
return `${
|
|
12
|
+
const getUserAgent = ({ appName }) => {
|
|
13
|
+
return `${appName} stepzen-sdk/${version} (${platform}; ${arch}; node-${process.version})`;
|
|
14
14
|
};
|
|
15
15
|
exports.getUserAgent = getUserAgent;
|
|
16
16
|
const getRequestHeaders = (account, sdkConfig) => {
|
|
@@ -18,7 +18,7 @@ const getRequestHeaders = (account, sdkConfig) => {
|
|
|
18
18
|
authorization: `Apikey ${account.adminkey}`,
|
|
19
19
|
host: `${account.account}.${account.domain}`,
|
|
20
20
|
'stepzen-cli-version': version,
|
|
21
|
-
'user-agent': exports.getUserAgent(sdkConfig),
|
|
21
|
+
'user-agent': (0, exports.getUserAgent)(sdkConfig),
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
exports.getRequestHeaders = getRequestHeaders;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/shared/request.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,yBAAwB;AACxB,gCAA+B;AAG/B,MAAM,EAAC,OAAO,EAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAE/C,sCAAsC;AACtC,wGAAwG;AACxG,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,CAAC,IAAI,EAAU,CAAA;AAC9D,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,CAAC,QAAQ,EAAU,CAAA;AAEhD,MAAM,YAAY,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/shared/request.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,yBAAwB;AACxB,gCAA+B;AAG/B,MAAM,EAAC,OAAO,EAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAE/C,sCAAsC;AACtC,wGAAwG;AACxG,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,CAAC,IAAI,EAAU,CAAA;AAC9D,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,CAAC,QAAQ,EAAU,CAAA;AAEhD,MAAM,YAAY,GAAG,CAAC,EAAC,OAAO,EAAoB,EAAU,EAAE;IACnE,OAAO,GAAG,OAAO,gBAAgB,OAAO,KAAK,QAAQ,KAAK,IAAI,UAAU,OAAO,CAAC,OAAO,GAAG,CAAA;AAC5F,CAAC,CAAA;AAFY,QAAA,YAAY,gBAExB;AAEM,MAAM,iBAAiB,GAAG,CAC/B,OAAuB,EACvB,SAA2B,EACL,EAAE;IACxB,OAAO;QACL,aAAa,EAAE,UAAU,OAAO,CAAC,QAAQ,EAAE;QAC3C,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE;QAC5C,qBAAqB,EAAE,OAAO;QAC9B,YAAY,EAAE,IAAA,oBAAY,EAAC,SAAS,CAAC;KACtC,CAAA;AACH,CAAC,CAAA;AAVY,QAAA,iBAAiB,qBAU7B"}
|
|
@@ -6,7 +6,7 @@ const dotenv = require("dotenv");
|
|
|
6
6
|
const fs = require("fs-extra");
|
|
7
7
|
const os = require("os");
|
|
8
8
|
const path = require("path");
|
|
9
|
-
const
|
|
9
|
+
const transpiler_1 = require("@stepzen/transpiler");
|
|
10
10
|
const transpileConfigurationset = async (file) => {
|
|
11
11
|
if (!file) {
|
|
12
12
|
return;
|
|
@@ -17,7 +17,7 @@ const transpileConfigurationset = async (file) => {
|
|
|
17
17
|
const configPath = path.join(tmp, 'config.yaml');
|
|
18
18
|
fs.ensureDirSync(tmp);
|
|
19
19
|
fs.copyFileSync(file, configPath);
|
|
20
|
-
const result = await transpile(tmp);
|
|
20
|
+
const result = await (0, transpiler_1.transpile)(tmp);
|
|
21
21
|
if (result.transpiled) {
|
|
22
22
|
fs.emptyDirSync(tmp);
|
|
23
23
|
fs.writeFileSync(configPath, result.config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transpiling.js","sourceRoot":"","sources":["../../src/shared/transpiling.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,iCAAgC;AAChC,+BAA8B;AAC9B,yBAAwB;AACxB,6BAA4B;
|
|
1
|
+
{"version":3,"file":"transpiling.js","sourceRoot":"","sources":["../../src/shared/transpiling.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,iCAAgC;AAChC,+BAA8B;AAC9B,yBAAwB;AACxB,6BAA4B;AAC5B,oDAA6C;AAEtC,MAAM,yBAAyB,GAAG,KAAK,EAC5C,IAAwB,EACK,EAAE;IAC/B,IAAI,CAAC,IAAI,EAAE;QACT,OAAM;KACP;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IACvD,MAAM,CAAC,MAAM,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAAC,CAAC,CAAA;IAEnD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,sBAAsB,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IACtE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;IAEhD,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IACrB,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;IAEjC,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAS,EAAC,GAAG,CAAC,CAAA;IAEnC,IAAI,MAAM,CAAC,UAAU,EAAE;QACrB,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;QACpB,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;QAC3C,OAAO,UAAU,CAAA;KAClB;IAED,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAClB,OAAM;AACR,CAAC,CAAA;AA1BY,QAAA,yBAAyB,6BA0BrC"}
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -73,4 +73,68 @@ export interface SDKConfiguration {
|
|
|
73
73
|
* through the SDK and becomes availabe in the log analytics.
|
|
74
74
|
*/
|
|
75
75
|
appName: string;
|
|
76
|
+
/**
|
|
77
|
+
* Version of ZenCtl API to use:
|
|
78
|
+
* - `undefined`, `v1`: implies the v1 REST API at /ctl/admin/
|
|
79
|
+
* - `v2`: implies the v2 GraphQL API
|
|
80
|
+
*/
|
|
81
|
+
apiVersion?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface SDKConfigurationV2 extends SDKConfiguration {
|
|
84
|
+
/**
|
|
85
|
+
* The name and version of that app that uses the SDK,
|
|
86
|
+
* e.g. `stepzen-cli/0.9.32`
|
|
87
|
+
*
|
|
88
|
+
* It is appended to the user-agent string in all requests made to StepZen
|
|
89
|
+
* through the SDK and becomes availabe in the log analytics.
|
|
90
|
+
*/
|
|
91
|
+
appName: string;
|
|
92
|
+
/**
|
|
93
|
+
* Version of ZenCtl API to use:
|
|
94
|
+
* - `undefined`, `v1`: implies the v1 REST API at /ctl/admin/
|
|
95
|
+
* - `v2`: implies the v2 GraphQL API
|
|
96
|
+
*/
|
|
97
|
+
apiVersion: string;
|
|
98
|
+
/**
|
|
99
|
+
* URL of the ZenCtl GraphQL API,
|
|
100
|
+
* e.g. https://braselton.stepzen.net/api/zenctl2/__graphql
|
|
101
|
+
*/
|
|
102
|
+
zenctlApiUrl: string;
|
|
103
|
+
/**
|
|
104
|
+
* URL of the StepZen getPublicAccount GraphQL API,
|
|
105
|
+
* e.g. https://stepzen.stepzen.net/api/publicaccount/__graphql
|
|
106
|
+
*/
|
|
107
|
+
publicAccountApiUrl: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ZenCtlSuccessResponseV2<T> {
|
|
110
|
+
data: T;
|
|
111
|
+
error: undefined;
|
|
112
|
+
}
|
|
113
|
+
export interface ZenCtlErrorResponseV2 {
|
|
114
|
+
data: undefined;
|
|
115
|
+
error: {
|
|
116
|
+
message: string;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export declare type ZenCtlResponseV2<T> = ZenCtlSuccessResponseV2<T> | ZenCtlErrorResponseV2;
|
|
120
|
+
export interface StepZenCredentialsV2 {
|
|
121
|
+
account: string;
|
|
122
|
+
adminKey: string;
|
|
123
|
+
serviceKey: string;
|
|
124
|
+
deploymentType: string;
|
|
125
|
+
}
|
|
126
|
+
export interface StepZenAccountV2 {
|
|
127
|
+
account: string;
|
|
128
|
+
ownerEmail: string;
|
|
129
|
+
adminKey: string;
|
|
130
|
+
serviceKey: string;
|
|
131
|
+
deploymentType: string;
|
|
132
|
+
}
|
|
133
|
+
export interface StepZenEndpointV2 {
|
|
134
|
+
account: string;
|
|
135
|
+
deploymentType: string;
|
|
136
|
+
folderName: string;
|
|
137
|
+
endpointName: string;
|
|
138
|
+
public: boolean;
|
|
139
|
+
endpointType: string;
|
|
76
140
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stepzen/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Darren Waddell <darren@stepzen.com>",
|
|
6
6
|
"homepage": "https://stepzen.com",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"posttest": "prettier . --check"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@stepzen/transpiler": "0.0
|
|
25
|
+
"@stepzen/transpiler": "0.2.0",
|
|
26
26
|
"archiver": "^5.3.0",
|
|
27
27
|
"debug": "^4.3.4",
|
|
28
28
|
"form-data": "^4.0.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"mocha": "^8.3.2",
|
|
49
49
|
"nyc": "^15.1.0",
|
|
50
50
|
"prettier": "^2.5.1",
|
|
51
|
-
"ts-node": "^
|
|
52
|
-
"typescript": "^4.
|
|
51
|
+
"ts-node": "^10.8.1",
|
|
52
|
+
"typescript": "^4.7.3"
|
|
53
53
|
},
|
|
54
54
|
"lint-staged": {
|
|
55
55
|
"*.{ts,js,css,md,yaml,json}": "prettier --write"
|