@openaisdk/billing-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Billing API
3
+ * API мультитенантной платформы биллинга: оформление подписок, checkout, платежи. **Аутентификация:** session cookie (human, после login/signup) **или** machine-to-machine: `Authorization: Bearer <api_key>`. Tenant выводится из сессии / ключа; заголовок `x-tenant-id` не является источником прав. **Idempotency:** для POST-операций создания рекомендуется заголовок `Idempotency-Key` для защиты от дублирования при повторах.
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ interface AWSv4Configuration {
13
+ options?: {
14
+ region?: string;
15
+ service?: string;
16
+ };
17
+ credentials?: {
18
+ accessKeyId?: string;
19
+ secretAccessKey?: string;
20
+ sessionToken?: string;
21
+ };
22
+ }
23
+ export interface ConfigurationParameters {
24
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
25
+ username?: string;
26
+ password?: string;
27
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
28
+ awsv4?: AWSv4Configuration;
29
+ basePath?: string;
30
+ serverIndex?: number;
31
+ baseOptions?: any;
32
+ formDataCtor?: new () => any;
33
+ }
34
+ export declare class Configuration {
35
+ /**
36
+ * parameter for apiKey security
37
+ * @param name security name
38
+ */
39
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
40
+ /**
41
+ * parameter for basic security
42
+ */
43
+ username?: string;
44
+ /**
45
+ * parameter for basic security
46
+ */
47
+ password?: string;
48
+ /**
49
+ * parameter for oauth2 security
50
+ * @param name security name
51
+ * @param scopes oauth2 scope
52
+ */
53
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
54
+ /**
55
+ * parameter for aws4 signature security
56
+ * @param {Object} AWS4Signature - AWS4 Signature security
57
+ * @param {string} options.region - aws region
58
+ * @param {string} options.service - name of the service.
59
+ * @param {string} credentials.accessKeyId - aws access key id
60
+ * @param {string} credentials.secretAccessKey - aws access key
61
+ * @param {string} credentials.sessionToken - aws session token
62
+ * @memberof Configuration
63
+ */
64
+ awsv4?: AWSv4Configuration;
65
+ /**
66
+ * override base path
67
+ */
68
+ basePath?: string;
69
+ /**
70
+ * override server index
71
+ */
72
+ serverIndex?: number;
73
+ /**
74
+ * base options for axios calls
75
+ */
76
+ baseOptions?: any;
77
+ /**
78
+ * The FormData constructor that will be used to create multipart form data
79
+ * requests. You can inject this here so that execution environments that
80
+ * do not support the FormData class can still run the generated client.
81
+ *
82
+ * @type {new () => FormData}
83
+ */
84
+ formDataCtor?: new () => any;
85
+ constructor(param?: ConfigurationParameters);
86
+ /**
87
+ * Check if the given MIME is a JSON MIME.
88
+ * JSON MIME examples:
89
+ * application/json
90
+ * application/json; charset=UTF8
91
+ * APPLICATION/JSON
92
+ * application/vnd.company+json
93
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
94
+ * @return True if the given MIME is JSON, false otherwise.
95
+ */
96
+ isJsonMime(mime: string): boolean;
97
+ }
98
+ export {};
99
+ //# sourceMappingURL=configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/generated/configuration.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AAEH,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,WAAW,CAAC,EAAE;QACZ,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,YAAY,CAAC,EAAE,MA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,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAClJ;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,UAAU,GAAG,CAAC;gBAEjB,KAAK,GAAE,uBAA4B;IAiB/C;;;;;;;;;OASG;IACI,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAI3C"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /**
4
+ * Billing API
5
+ * API мультитенантной платформы биллинга: оформление подписок, checkout, платежи. **Аутентификация:** session cookie (human, после login/signup) **или** machine-to-machine: `Authorization: Bearer <api_key>`. Tenant выводится из сессии / ключа; заголовок `x-tenant-id` не является источником прав. **Idempotency:** для POST-операций создания рекомендуется заголовок `Idempotency-Key` для защиты от дублирования при повторах.
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.Configuration = void 0;
16
+ class Configuration {
17
+ /**
18
+ * parameter for apiKey security
19
+ * @param name security name
20
+ */
21
+ apiKey;
22
+ /**
23
+ * parameter for basic security
24
+ */
25
+ username;
26
+ /**
27
+ * parameter for basic security
28
+ */
29
+ password;
30
+ /**
31
+ * parameter for oauth2 security
32
+ * @param name security name
33
+ * @param scopes oauth2 scope
34
+ */
35
+ accessToken;
36
+ /**
37
+ * parameter for aws4 signature security
38
+ * @param {Object} AWS4Signature - AWS4 Signature security
39
+ * @param {string} options.region - aws region
40
+ * @param {string} options.service - name of the service.
41
+ * @param {string} credentials.accessKeyId - aws access key id
42
+ * @param {string} credentials.secretAccessKey - aws access key
43
+ * @param {string} credentials.sessionToken - aws session token
44
+ * @memberof Configuration
45
+ */
46
+ awsv4;
47
+ /**
48
+ * override base path
49
+ */
50
+ basePath;
51
+ /**
52
+ * override server index
53
+ */
54
+ serverIndex;
55
+ /**
56
+ * base options for axios calls
57
+ */
58
+ baseOptions;
59
+ /**
60
+ * The FormData constructor that will be used to create multipart form data
61
+ * requests. You can inject this here so that execution environments that
62
+ * do not support the FormData class can still run the generated client.
63
+ *
64
+ * @type {new () => FormData}
65
+ */
66
+ formDataCtor;
67
+ constructor(param = {}) {
68
+ this.apiKey = param.apiKey;
69
+ this.username = param.username;
70
+ this.password = param.password;
71
+ this.accessToken = param.accessToken;
72
+ this.awsv4 = param.awsv4;
73
+ this.basePath = param.basePath;
74
+ this.serverIndex = param.serverIndex;
75
+ this.baseOptions = {
76
+ ...param.baseOptions,
77
+ headers: {
78
+ ...param.baseOptions?.headers,
79
+ },
80
+ };
81
+ this.formDataCtor = param.formDataCtor;
82
+ }
83
+ /**
84
+ * Check if the given MIME is a JSON MIME.
85
+ * JSON MIME examples:
86
+ * application/json
87
+ * application/json; charset=UTF8
88
+ * APPLICATION/JSON
89
+ * application/vnd.company+json
90
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
91
+ * @return True if the given MIME is JSON, false otherwise.
92
+ */
93
+ isJsonMime(mime) {
94
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
95
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
96
+ }
97
+ }
98
+ exports.Configuration = Configuration;
99
+ //# sourceMappingURL=configuration.js.map
@@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CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,6BAA6B,CAAC,CAAC;IAC1G,CAAC;CACJ;AAnFD,sCAmFC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Billing API
3
+ * API мультитенантной платформы биллинга: оформление подписок, checkout, платежи. **Аутентификация:** session cookie (human, после login/signup) **или** machine-to-machine: `Authorization: Bearer <api_key>`. Tenant выводится из сессии / ключа; заголовок `x-tenant-id` не является источником прав. **Idempotency:** для POST-операций создания рекомендуется заголовок `Idempotency-Key` для защиты от дублирования при повторах.
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export * from "./api";
13
+ export * from "./configuration";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Billing API
6
+ * API мультитенантной платформы биллинга: оформление подписок, checkout, платежи. **Аутентификация:** session cookie (human, после login/signup) **или** machine-to-machine: `Authorization: Bearer <api_key>`. Tenant выводится из сессии / ключа; заголовок `x-tenant-id` не является источником прав. **Idempotency:** для POST-операций создания рекомендуется заголовок `Idempotency-Key` для защиты от дублирования при повторах.
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ __exportStar(require("./api"), exports);
31
+ __exportStar(require("./configuration"), exports);
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;AAGH,wCAAsB;AACtB,kDAAgC"}
@@ -0,0 +1,3 @@
1
+ export * from './generated';
2
+ export * from './config';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // SDK для Billing API
18
+ __exportStar(require("./generated"), exports);
19
+ __exportStar(require("./config"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sBAAsB;AACtB,8CAA4B;AAC5B,2CAAyB"}
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@openaisdk/billing-sdk",
3
+ "version": "1.0.0",
4
+ "description": "TypeScript SDK для Billing API — customer account, checkout, access",
5
+ "license": "MIT",
6
+ "author": "Anatoliy Tukov <openaisdk@gmail.com>",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/MegaRetroHQ/saas-billing.git",
10
+ "directory": "packages/billing-sdk"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/MegaRetroHQ/saas-billing/issues"
14
+ },
15
+ "homepage": "https://www.npmjs.com/package/@openaisdk/billing-sdk",
16
+ "keywords": [
17
+ "billing",
18
+ "saas",
19
+ "subscriptions",
20
+ "checkout",
21
+ "typescript",
22
+ "openapi",
23
+ "axios",
24
+ "openapi-generator",
25
+ "megaretro"
26
+ ],
27
+ "engines": {
28
+ "node": ">=20"
29
+ },
30
+ "main": "dist/index.js",
31
+ "types": "dist/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ }
37
+ },
38
+ "sideEffects": false,
39
+ "files": [
40
+ "dist",
41
+ "README.md",
42
+ ".env.example"
43
+ ],
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "scripts": {
48
+ "prepublishOnly": "npm run build",
49
+ "build": "tsc",
50
+ "clean": "rm -rf dist src/generated",
51
+ "sdk": "openapi-generator-cli generate -i http://localhost:4001/api-json -g typescript-axios -o src/generated --skip-validate-spec",
52
+ "sdk:generate": "node scripts/generate-with-api.js",
53
+ "sdk:build": "pnpm run sdk:generate && pnpm run build",
54
+ "lint": "eslint ."
55
+ },
56
+ "dependencies": {
57
+ "axios": "^1.7.0"
58
+ },
59
+ "devDependencies": {
60
+ "@openapitools/openapi-generator-cli": "^2.7.0",
61
+ "@saas-billing/eslint-config": "workspace:*",
62
+ "@saas-billing/typescript-config": "workspace:*",
63
+ "typescript": "^5.7.0"
64
+ }
65
+ }