@surgent-dev/surpay 0.1.2 → 0.1.4
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/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/surpay.d.ts +8 -3
- package/dist/surpay.d.ts.map +1 -1
- package/dist/surpay.js +11 -5
- package/dist/surpay.js.map +1 -1
- package/dist/types.d.ts +22 -27
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/result.d.ts.map +1 -1
- package/dist/utils/result.js +18 -9
- package/dist/utils/result.js.map +1 -1
- package/package.json +3 -8
- package/LICENSE +0 -201
- package/README.md +0 -15
- package/dist/surpay-admin.d.ts +0 -14
- package/dist/surpay-admin.d.ts.map +0 -1
- package/dist/surpay-admin.js +0 -24
- package/dist/surpay-admin.js.map +0 -1
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,qBAAa,YAAY;IACvB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAClC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;gBAEtC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;cAQzC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;cAQrD,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;cAStE,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;cASpE,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;CAOzE"}
|
package/dist/client.js
CHANGED
|
@@ -11,7 +11,7 @@ export class SurpayClient {
|
|
|
11
11
|
constructor(options) {
|
|
12
12
|
this.baseUrl = options.baseUrl || DEFAULT_BASE_URL;
|
|
13
13
|
this.headers = {
|
|
14
|
-
|
|
14
|
+
Authorization: `Bearer ${options.apiKey}`,
|
|
15
15
|
'Content-Type': 'application/json',
|
|
16
16
|
};
|
|
17
17
|
}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAI5C,MAAM,gBAAgB,GAAG,yBAAyB,CAAA;AAElD,MAAM,OAAO,YAAY;IACJ,OAAO,CAAQ;IACf,OAAO,CAAwB;IA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,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,EAAE;YACrD,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAA;QACF,OAAO,QAAQ,CAAI,QAAQ,CAAC,CAAA;IAC9B,CAAC;CACF"}
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;gBAEf,EAAE,OAAO,EAAE,IAAI,EAAE,UAAgB,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;IAWvG,QAAQ,IAAI,MAAM;CAGnB;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,WAEvD,CAAA"}
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAQ;IACZ,UAAU,CAAQ;IAE3B,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,GAAG,EAA0D;QACrG,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC;IAED,QAAQ;QACN,OAAO,gBAAgB,IAAI,CAAC,OAAO,WAAW,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,UAAU,GAAG,CAAA;IACxF,CAAC;CACF;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAwB,EAAE;IACpE,OAAO,KAAK,YAAY,WAAW,CAAA;AACrC,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* ```typescript
|
|
8
8
|
* import { Surpay } from 'surpay'
|
|
9
9
|
*
|
|
10
|
-
* const surpay = new Surpay({ apiKey: '
|
|
10
|
+
* const surpay = new Surpay({ apiKey: 'xKmZqWpNrTsYvBcDfGhJkLmNpQrStUvWxYzAbCdEfGhJkLmNpQrStUvWxYzAbCd' })
|
|
11
11
|
*
|
|
12
12
|
* // Create a checkout session
|
|
13
13
|
* const { data, error } = await surpay.checkout.create({
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export { Surpay } from './surpay.js';
|
|
30
|
-
export { SurpayAdmin } from './surpay-admin.js';
|
|
31
30
|
export { SurpayError, isSurpayError } from './errors.js';
|
|
32
|
-
export type { Result, Success, Failure, SurpayConfig,
|
|
31
|
+
export type { Result, Success, Failure, SurpayConfig, SubscriptionStatus, RecurringInterval, TransactionType, CheckoutStatus, CheckoutMode, PayoutStatus, Project, Customer, CustomerWithDetails, TransactionSummary, SubscriptionSummary, Product, CreateProductRequest, CreateProductResponse, UpdateProductRequest, UpdateProductResponse, ProductWithPrices, ProductPrice, CreatePriceRequest, CreatePriceResponse, CreateCheckoutRequest, CreateCheckoutResponse, CheckRequest, CheckResponse, Transaction, Subscription, ConnectAccountRequest, ConnectAccountResponse, ConnectedAccount, } from './types.js';
|
|
33
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGxD,YAAY,EAEV,MAAM,EACN,OAAO,EACP,OAAO,EAGP,YAAY,EAGZ,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EAGZ,OAAO,EAGP,QAAQ,EACR,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EAGnB,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EAGjB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EAGnB,qBAAqB,EACrB,sBAAsB,EAGtB,YAAY,EACZ,aAAa,EAGb,WAAW,EAGX,YAAY,EAGZ,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* ```typescript
|
|
8
8
|
* import { Surpay } from 'surpay'
|
|
9
9
|
*
|
|
10
|
-
* const surpay = new Surpay({ apiKey: '
|
|
10
|
+
* const surpay = new Surpay({ apiKey: 'xKmZqWpNrTsYvBcDfGhJkLmNpQrStUvWxYzAbCdEfGhJkLmNpQrStUvWxYzAbCd' })
|
|
11
11
|
*
|
|
12
12
|
* // Create a checkout session
|
|
13
13
|
* const { data, error } = await surpay.checkout.create({
|
|
@@ -26,9 +26,8 @@
|
|
|
26
26
|
* console.log(data.checkout_url)
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
// Main
|
|
29
|
+
// Main client
|
|
30
30
|
export { Surpay } from './surpay.js';
|
|
31
|
-
export { SurpayAdmin } from './surpay-admin.js';
|
|
32
31
|
// Error handling
|
|
33
32
|
export { SurpayError, isSurpayError } from './errors.js';
|
|
34
33
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,cAAc;AACd,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,iBAAiB;AACjB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/surpay.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Uses grouped method namespaces (Autumn pattern).
|
|
6
6
|
*/
|
|
7
7
|
import { SurpayClient } from './client.js';
|
|
8
|
-
import type { SurpayConfig, Customer, CustomerWithDetails, CreateProductRequest, CreateProductResponse, UpdateProductRequest, UpdateProductResponse, ProductWithPrices, CreatePriceRequest, CreatePriceResponse, CreateCheckoutRequest, CreateCheckoutResponse,
|
|
8
|
+
import type { SurpayConfig, Customer, CustomerWithDetails, CreateProductRequest, CreateProductResponse, UpdateProductRequest, UpdateProductResponse, ProductWithPrices, CreatePriceRequest, CreatePriceResponse, CreateCheckoutRequest, CreateCheckoutResponse, CheckRequest, CheckResponse, Subscription, Transaction, Project, ConnectAccountRequest, ConnectAccountResponse, ConnectedAccount } from './types.js';
|
|
9
9
|
export declare class Surpay extends SurpayClient {
|
|
10
10
|
constructor(options?: SurpayConfig);
|
|
11
11
|
customers: {
|
|
@@ -23,6 +23,7 @@ export declare class Surpay extends SurpayClient {
|
|
|
23
23
|
checkout: {
|
|
24
24
|
create: (params: CreateCheckoutRequest) => Promise<import("./types.js").Result<CreateCheckoutResponse, import("./errors.js").SurpayError>>;
|
|
25
25
|
};
|
|
26
|
+
check: (params: CheckRequest) => Promise<import("./types.js").Result<CheckResponse, import("./errors.js").SurpayError>>;
|
|
26
27
|
subscriptions: {
|
|
27
28
|
list: (projectId: string) => Promise<import("./types.js").Result<Subscription[], import("./errors.js").SurpayError>>;
|
|
28
29
|
};
|
|
@@ -30,13 +31,17 @@ export declare class Surpay extends SurpayClient {
|
|
|
30
31
|
list: (projectId: string) => Promise<import("./types.js").Result<Transaction[], import("./errors.js").SurpayError>>;
|
|
31
32
|
};
|
|
32
33
|
projects: {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
list: () => Promise<import("./types.js").Failure<import("./errors.js").SurpayError> | {
|
|
35
|
+
data: Project[];
|
|
36
|
+
error: null;
|
|
37
|
+
statusCode: number;
|
|
38
|
+
}>;
|
|
35
39
|
};
|
|
36
40
|
accounts: {
|
|
37
41
|
connect: (params: ConnectAccountRequest) => Promise<import("./types.js").Result<ConnectAccountResponse, import("./errors.js").SurpayError>>;
|
|
38
42
|
get: (accountId: string) => Promise<import("./types.js").Result<ConnectedAccount, import("./errors.js").SurpayError>>;
|
|
39
43
|
list: () => Promise<import("./types.js").Result<ConnectedAccount[], import("./errors.js").SurpayError>>;
|
|
44
|
+
delete: (accountId: string) => Promise<import("./types.js").Result<void, import("./errors.js").SurpayError>>;
|
|
40
45
|
};
|
|
41
46
|
}
|
|
42
47
|
//# sourceMappingURL=surpay.d.ts.map
|
package/dist/surpay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surpay.d.ts","sourceRoot":"","sources":["../src/surpay.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"surpay.d.ts","sourceRoot":"","sources":["../src/surpay.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,YAAY,CAAA;AAEnB,qBAAa,MAAO,SAAQ,YAAY;gBAC1B,OAAO,CAAC,EAAE,YAAY;IAYlC,SAAS;0BACW,MAAM;yBAEP,MAAM,cAAc,MAAM;MAE5C;IAED,QAAQ;yBACW,oBAAoB;4BAEjB,MAAM,UAAU,oBAAoB;oCAG5B,MAAM;MACnC;IAED,MAAM;yBACa,kBAAkB;MACpC;IAED,QAAQ;yBACW,qBAAqB;MACvC;IAED,KAAK,GAAI,QAAQ,YAAY,4FAA+C;IAE5E,aAAa;0BACO,MAAM;MACzB;IAED,YAAY;0BACQ,MAAM;MACzB;IAED,QAAQ;;;;;;MAUP;IAED,QAAQ;0BACY,qBAAqB;yBAEtB,MAAM;;4BAIH,MAAM;MAC3B;CACF"}
|
package/dist/surpay.js
CHANGED
|
@@ -13,9 +13,6 @@ export class Surpay extends SurpayClient {
|
|
|
13
13
|
if (!apiKey) {
|
|
14
14
|
throw new Error('Surpay API key is required. Pass it via options or set SURPAY_API_KEY env var.');
|
|
15
15
|
}
|
|
16
|
-
if (!apiKey.startsWith('sp_org_')) {
|
|
17
|
-
throw new Error('Invalid API key format. Tenant keys must start with sp_org_');
|
|
18
|
-
}
|
|
19
16
|
super({ apiKey, baseUrl });
|
|
20
17
|
}
|
|
21
18
|
customers = {
|
|
@@ -33,6 +30,7 @@ export class Surpay extends SurpayClient {
|
|
|
33
30
|
checkout = {
|
|
34
31
|
create: (params) => this.post('/checkout', params),
|
|
35
32
|
};
|
|
33
|
+
check = (params) => this.post('/check', params);
|
|
36
34
|
subscriptions = {
|
|
37
35
|
list: (projectId) => this.get(`/project/${projectId}/subscriptions`),
|
|
38
36
|
};
|
|
@@ -40,13 +38,21 @@ export class Surpay extends SurpayClient {
|
|
|
40
38
|
list: (projectId) => this.get(`/project/${projectId}/transactions`),
|
|
41
39
|
};
|
|
42
40
|
projects = {
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
list: async () => {
|
|
42
|
+
const result = await this.get('/projects');
|
|
43
|
+
if (result.error) {
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
// Normalize wrapped response: { projects: [...] } -> [...]
|
|
47
|
+
const data = Array.isArray(result.data) ? result.data : result.data.projects || [];
|
|
48
|
+
return { data, error: null, statusCode: result.statusCode };
|
|
49
|
+
},
|
|
45
50
|
};
|
|
46
51
|
accounts = {
|
|
47
52
|
connect: (params) => this.post('/accounts/connect', params),
|
|
48
53
|
get: (accountId) => this.get(`/accounts/${accountId}`),
|
|
49
54
|
list: () => this.get('/accounts'),
|
|
55
|
+
delete: (accountId) => this.delete(`/accounts/${accountId}`),
|
|
50
56
|
};
|
|
51
57
|
}
|
|
52
58
|
//# sourceMappingURL=surpay.js.map
|
package/dist/surpay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surpay.js","sourceRoot":"","sources":["../src/surpay.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"surpay.js","sourceRoot":"","sources":["../src/surpay.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAwB1C,MAAM,OAAO,MAAO,SAAQ,YAAY;IACtC,YAAY,OAAsB;QAChC,MAAM,SAAS,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAA;QACzF,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,SAAS,IAAI,EAAE,CAAA;QACjD,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,CAAA;QAEhC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAA;QACnG,CAAC;QAED,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IAC5B,CAAC;IAED,SAAS,GAAG;QACV,IAAI,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAa,YAAY,SAAS,YAAY,CAAC;QAEpF,GAAG,EAAE,CAAC,SAAiB,EAAE,UAAkB,EAAE,EAAE,CAC7C,IAAI,CAAC,GAAG,CAAsB,YAAY,SAAS,aAAa,UAAU,EAAE,CAAC;KAChF,CAAA;IAED,QAAQ,GAAG;QACT,MAAM,EAAE,CAAC,MAA4B,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAwB,UAAU,EAAE,MAAM,CAAC;QAE9F,MAAM,EAAE,CAAC,SAAiB,EA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AO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAA;QAC7D,CAAC;KACF,CAAA;IAED,QAAQ,GAAG;QACT,OAAO,EAAE,CAAC,MAA6B,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAyB,mBAAmB,EAAE,MAAM,CAAC;QAE1G,GAAG,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAmB,aAAa,SAAS,EAAE,CAAC;QAEhF,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAqB,WAAW,CAAC;QAErD,MAAM,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAO,aAAa,SAAS,EAAE,CAAC;KAC3E,CAAA;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -20,27 +20,13 @@ export type RecurringInterval = 'day' | 'week' | 'month' | 'year';
|
|
|
20
20
|
export type TransactionType = 'payment' | 'processor_fee' | 'refund' | 'dispute' | 'balance' | 'payout';
|
|
21
21
|
export type CheckoutStatus = 'open' | 'complete' | 'expired';
|
|
22
22
|
export type CheckoutMode = 'payment' | 'subscription' | 'setup';
|
|
23
|
-
export
|
|
24
|
-
name: string;
|
|
25
|
-
slug: string;
|
|
26
|
-
}
|
|
27
|
-
export interface CreateOrganizationResponse {
|
|
28
|
-
id: string;
|
|
29
|
-
api_key: string;
|
|
30
|
-
}
|
|
31
|
-
export interface CreateProjectRequest {
|
|
32
|
-
name: string;
|
|
33
|
-
slug: string;
|
|
34
|
-
external_id?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface CreateProjectResponse {
|
|
37
|
-
id: string;
|
|
38
|
-
}
|
|
23
|
+
export type PayoutStatus = 'paid' | 'pending' | 'in_transit' | 'canceled' | 'failed';
|
|
39
24
|
export interface Project {
|
|
40
25
|
id: string;
|
|
41
26
|
name: string;
|
|
42
27
|
slug?: string;
|
|
43
28
|
external_id?: string | null;
|
|
29
|
+
organization_id?: string | null;
|
|
44
30
|
}
|
|
45
31
|
export interface Customer {
|
|
46
32
|
id: string;
|
|
@@ -133,13 +119,25 @@ export interface ProductWithPrices {
|
|
|
133
119
|
}
|
|
134
120
|
export interface CreateCheckoutRequest {
|
|
135
121
|
product_id: string;
|
|
136
|
-
price_id
|
|
137
|
-
success_url
|
|
138
|
-
cancel_url
|
|
122
|
+
price_id?: string;
|
|
123
|
+
success_url?: string;
|
|
124
|
+
cancel_url?: string;
|
|
125
|
+
customer_id: string;
|
|
126
|
+
customer_data?: {
|
|
127
|
+
email?: string;
|
|
128
|
+
name?: string;
|
|
129
|
+
};
|
|
139
130
|
}
|
|
140
131
|
export interface CreateCheckoutResponse {
|
|
141
132
|
checkout_url: string;
|
|
142
|
-
|
|
133
|
+
customer_id: string;
|
|
134
|
+
}
|
|
135
|
+
export interface CheckRequest {
|
|
136
|
+
customer_id: string;
|
|
137
|
+
product_id: string;
|
|
138
|
+
}
|
|
139
|
+
export interface CheckResponse {
|
|
140
|
+
allowed: boolean;
|
|
143
141
|
}
|
|
144
142
|
export interface Transaction {
|
|
145
143
|
id: string;
|
|
@@ -194,6 +192,8 @@ export interface Subscription {
|
|
|
194
192
|
project_id?: string | null;
|
|
195
193
|
}
|
|
196
194
|
export interface ConnectAccountRequest {
|
|
195
|
+
/** Required for session auth, optional for API key auth */
|
|
196
|
+
project_id?: string;
|
|
197
197
|
processor: string;
|
|
198
198
|
account_type?: string;
|
|
199
199
|
country?: string;
|
|
@@ -206,6 +206,7 @@ export interface ConnectAccountResponse {
|
|
|
206
206
|
}
|
|
207
207
|
export interface ConnectedAccount {
|
|
208
208
|
id: string;
|
|
209
|
+
project_id: string;
|
|
209
210
|
processor: string;
|
|
210
211
|
status: string;
|
|
211
212
|
country: string;
|
|
@@ -217,15 +218,9 @@ export interface ConnectedAccount {
|
|
|
217
218
|
processor_account_id?: string | null;
|
|
218
219
|
}
|
|
219
220
|
export interface SurpayConfig {
|
|
220
|
-
/** Your Surpay API key (
|
|
221
|
+
/** Your Surpay API key (64 alphabetic characters) */
|
|
221
222
|
apiKey?: string;
|
|
222
223
|
/** Override the base URL (default: https://api.surpay.io) */
|
|
223
224
|
baseUrl?: string;
|
|
224
225
|
}
|
|
225
|
-
export interface SurpayAdminConfig {
|
|
226
|
-
/** Your Surpay master key (format: sp_master_xxx) */
|
|
227
|
-
masterKey?: string;
|
|
228
|
-
/** Override the base URL (default: https://api.surpay.io) */
|
|
229
|
-
baseUrl?: string;
|
|
230
|
-
}
|
|
231
226
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AACrE,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AACrE,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAM5D,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,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gB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAMD,MAAM,WAAW,qBAAqB;IACpC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,eAAe,EAAE,OAAO,CAAA;IACxB,eAAe,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrC;AAMD,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../src/utils/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../src/utils/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAU,CAAC,EAAE,UAAU,QAAQ,KAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAmCpF,CAAA"}
|
package/dist/utils/result.js
CHANGED
|
@@ -39,15 +39,24 @@ export const toResult = async (response) => {
|
|
|
39
39
|
};
|
|
40
40
|
const statusToCode = (status) => {
|
|
41
41
|
switch (status) {
|
|
42
|
-
case 400:
|
|
43
|
-
|
|
44
|
-
case
|
|
45
|
-
|
|
46
|
-
case
|
|
47
|
-
|
|
48
|
-
case
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
case 400:
|
|
43
|
+
return 'bad_request';
|
|
44
|
+
case 401:
|
|
45
|
+
return 'unauthorized';
|
|
46
|
+
case 403:
|
|
47
|
+
return 'forbidden';
|
|
48
|
+
case 404:
|
|
49
|
+
return 'not_found';
|
|
50
|
+
case 409:
|
|
51
|
+
return 'conflict';
|
|
52
|
+
case 422:
|
|
53
|
+
return 'validation_error';
|
|
54
|
+
case 429:
|
|
55
|
+
return 'rate_limit_exceeded';
|
|
56
|
+
case 500:
|
|
57
|
+
return 'internal_error';
|
|
58
|
+
default:
|
|
59
|
+
return 'unknown_error';
|
|
51
60
|
}
|
|
52
61
|
};
|
|
53
62
|
//# sourceMappingURL=result.js.map
|
package/dist/utils/result.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/utils/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/utils/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,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N,OAAO,cAAc,CAAA;QACvB,KAAK,GAAG;YACN,OAAO,WAAW,CAAA;QACpB,KAAK,GAAG;YACN,OAAO,WAAW,CAAA;QACpB,KAAK,GAAG;YACN,OAAO,UAAU,CAAA;QACnB,KAAK,GAAG;YACN,OAAO,kBAAkB,CAAA;QAC3B,KAAK,GAAG;YACN,OAAO,qBAAqB,CAAA;QAC9B,KAAK,GAAG;YACN,OAAO,gBAAgB,CAAA;QACzB;YACE,OAAO,eAAe,CAAA;IAC1B,CAAC;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surgent-dev/surpay",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Official Surpay SDK for TypeScript/JavaScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,13 +18,8 @@
|
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsc",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"clean": "rm -rf dist",
|
|
24
|
-
"prepublishOnly": "bun install && bun run clean && bun run build",
|
|
25
|
-
"changeset": "bunx changeset",
|
|
26
|
-
"changeset:version": "bunx changeset version",
|
|
27
|
-
"changeset:release": "bunx changeset publish"
|
|
21
|
+
"watch": "tsc --watch",
|
|
22
|
+
"clean": "rm -rf dist"
|
|
28
23
|
},
|
|
29
24
|
"keywords": [
|
|
30
25
|
"surpay",
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
package/README.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# surpay
|
|
2
|
-
|
|
3
|
-
To install dependencies:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
bun install
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
To run:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
bun run dist/index.js
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
This project was created using `bun init` in bun v1.3.6. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|
package/dist/surpay-admin.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Surpay Admin Client
|
|
3
|
-
*
|
|
4
|
-
* SDK client for organization-level operations (master key required).
|
|
5
|
-
*/
|
|
6
|
-
import { SurpayClient } from './client.js';
|
|
7
|
-
import type { SurpayAdminConfig, CreateOrganizationRequest, CreateOrganizationResponse } from './types.js';
|
|
8
|
-
export declare class SurpayAdmin extends SurpayClient {
|
|
9
|
-
constructor(options?: SurpayAdminConfig);
|
|
10
|
-
organization: {
|
|
11
|
-
create: (params: CreateOrganizationRequest) => Promise<import("./types.js").Result<CreateOrganizationResponse, import("./errors.js").SurpayError>>;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=surpay-admin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"surpay-admin.d.ts","sourceRoot":"","sources":["../src/surpay-admin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EACV,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAEpB,qBAAa,WAAY,SAAQ,YAAY;gBAC/B,OAAO,CAAC,EAAE,iBAAiB;IAgBvC,YAAY;yBACO,yBAAyB;MAE1C;CACH"}
|
package/dist/surpay-admin.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Surpay Admin Client
|
|
3
|
-
*
|
|
4
|
-
* SDK client for organization-level operations (master key required).
|
|
5
|
-
*/
|
|
6
|
-
import { SurpayClient } from './client.js';
|
|
7
|
-
export class SurpayAdmin extends SurpayClient {
|
|
8
|
-
constructor(options) {
|
|
9
|
-
const envMasterKey = typeof process !== 'undefined' ? process.env.SURPAY_MASTER_KEY : undefined;
|
|
10
|
-
const masterKey = options?.masterKey || envMasterKey || '';
|
|
11
|
-
const baseUrl = options?.baseUrl;
|
|
12
|
-
if (!masterKey) {
|
|
13
|
-
throw new Error('Surpay master key is required. Pass it via options or set SURPAY_MASTER_KEY env var.');
|
|
14
|
-
}
|
|
15
|
-
if (!masterKey.startsWith('sp_master_')) {
|
|
16
|
-
throw new Error('Invalid master key format. Admin keys must start with sp_master_');
|
|
17
|
-
}
|
|
18
|
-
super({ apiKey: masterKey, baseUrl });
|
|
19
|
-
}
|
|
20
|
-
organization = {
|
|
21
|
-
create: (params) => this.post('/organization', params),
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=surpay-admin.js.map
|
package/dist/surpay-admin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"surpay-admin.js","sourceRoot":"","sources":["../src/surpay-admin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,MAAM,OAAO,WAAY,SAAQ,YAAY;IAC3C,YAAY,OAA2B;QACrC,MAAM,YAAY,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;QAChG,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,YAAY,IAAI,EAAE,CAAC;QAC3D,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,CAAC;QAEjC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC1G,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACtF,CAAC;QAED,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,YAAY,GAAG;QACb,MAAM,EAAE,CAAC,MAAiC,EAAE,EAAE,CAC5C,IAAI,CAAC,IAAI,CAA6B,eAAe,EAAE,MAAM,CAAC;KACjE,CAAC;CACH"}
|