@xyo-network/rebilly-payment-card-authorization-plugin 2.99.5 → 2.99.6
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/browser/Sentinel.d.cts +1 -1
- package/dist/browser/Sentinel.d.cts.map +1 -1
- package/dist/browser/Sentinel.d.mts +1 -1
- package/dist/browser/Sentinel.d.mts.map +1 -1
- package/dist/browser/Sentinel.d.ts +1 -1
- package/dist/browser/Sentinel.d.ts.map +1 -1
- package/dist/browser/index.cjs +34 -52
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.mjs +34 -54
- package/dist/browser/index.mjs.map +1 -1
- package/dist/neutral/Sentinel.d.cts +1 -1
- package/dist/neutral/Sentinel.d.cts.map +1 -1
- package/dist/neutral/Sentinel.d.mts +1 -1
- package/dist/neutral/Sentinel.d.mts.map +1 -1
- package/dist/neutral/Sentinel.d.ts +1 -1
- package/dist/neutral/Sentinel.d.ts.map +1 -1
- package/dist/neutral/index.cjs +34 -52
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.mjs +34 -54
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/Sentinel.d.cts +1 -1
- package/dist/node/Sentinel.d.cts.map +1 -1
- package/dist/node/Sentinel.d.mts +1 -1
- package/dist/node/Sentinel.d.mts.map +1 -1
- package/dist/node/Sentinel.d.ts +1 -1
- package/dist/node/Sentinel.d.ts.map +1 -1
- package/dist/node/index.cjs +36 -55
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +36 -57
- package/dist/node/index.mjs.map +1 -1
- package/package.json +15 -14
- package/src/Sentinel.ts +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from '@xylabs/axios';
|
|
2
1
|
import { Payload } from '@xyo-network/payload-model';
|
|
3
2
|
import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
|
|
4
3
|
import { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model';
|
|
4
|
+
import { AxiosRequestConfig } from 'axios';
|
|
5
5
|
import { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts';
|
|
6
6
|
export declare class RebillyPaymentCardAuthorizationSentinel<TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
|
|
7
7
|
static configSchemas: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAkB,MAAM,OAAO,CAAA;AAI1D,OAAO,EAAE,6CAA6C,EAAE,MAAM,aAAa,CAAA;AAS3E,qBAAa,uCAAuC,CAClD,OAAO,SAAS,6CAA6C,GAAG,6CAA6C,EAC7G,UAAU,SAAS,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAC1H,SAAQ,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7C,OAAgB,aAAa,WAAwD;IACrF,OAAgB,mBAAmB,SAAsD;IAEzF,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAY;IAClD,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAY;IACjD,SAAS,CAAC,QAAQ,EAAE,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAY;IACzE,SAAS,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAY;IACzD,SAAS,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAY;IAC5D,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAY;IAKxD,SAAS,KAAK,OAAO,WAGpB;IAKD,SAAS,KAAK,MAAM,WAGnB;IAKD,SAAS,KAAK,OAAO,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAGrD;IAKD,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAKD,SAAS,KAAK,cAAc,WAO3B;IAKD,SAAS,KAAK,iBAAiB,IAAI,MAAM,CAIxC;IAKD,SAAS,KAAK,aAAa,WAG1B;IAEc,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAsBvE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from '@xylabs/axios';
|
|
2
1
|
import { Payload } from '@xyo-network/payload-model';
|
|
3
2
|
import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
|
|
4
3
|
import { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model';
|
|
4
|
+
import { AxiosRequestConfig } from 'axios';
|
|
5
5
|
import { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts';
|
|
6
6
|
export declare class RebillyPaymentCardAuthorizationSentinel<TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
|
|
7
7
|
static configSchemas: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"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D,SAAS,KAAK,aAAa,WAG1B;IAEc,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAsBvE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from '@xylabs/axios';
|
|
2
1
|
import { Payload } from '@xyo-network/payload-model';
|
|
3
2
|
import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
|
|
4
3
|
import { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model';
|
|
4
|
+
import { AxiosRequestConfig } from 'axios';
|
|
5
5
|
import { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts';
|
|
6
6
|
export declare class RebillyPaymentCardAuthorizationSentinel<TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
|
|
7
7
|
static configSchemas: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAkB,MAAM,OAAO,CAAA;AAI1D,OAAO,EAAE,6CAA6C,EAAE,MAAM,aAAa,CAAA;AAS3E,qBAAa,uCAAuC,CAClD,OAAO,SAAS,6CAA6C,GAAG,6CAA6C,EAC7G,UAAU,SAAS,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAC1H,SAAQ,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7C,OAAgB,aAAa,WAAwD;IACrF,OAAgB,mBAAmB,SAAsD;IAEzF,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAY;IAClD,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAY;IACjD,SAAS,CAAC,QAAQ,EAAE,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAY;IACzE,SAAS,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAY;IACzD,SAAS,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAY;IAC5D,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAY;IAKxD,SAAS,KAAK,OAAO,WAGpB;IAKD,SAAS,KAAK,MAAM,WAGnB;IAKD,SAAS,KAAK,OAAO,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAGrD;IAKD,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAKD,SAAS,KAAK,cAAc,WAO3B;IAKD,SAAS,KAAK,iBAAiB,IAAI,MAAM,CAIxC;IAKD,SAAS,KAAK,aAAa,WAG1B;IAEc,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAsBvE"}
|
package/dist/browser/index.cjs
CHANGED
|
@@ -3,7 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
6
|
var __export = (target, all) => {
|
|
8
7
|
for (var name in all)
|
|
9
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -40,38 +39,27 @@ var import_payload_builder = require("@xyo-network/payload-builder");
|
|
|
40
39
|
var import_payment_payload_plugins = require("@xyo-network/payment-payload-plugins");
|
|
41
40
|
var import_rebilly_payment_payload_plugin = require("@xyo-network/rebilly-payment-payload-plugin");
|
|
42
41
|
var import_sentinel_abstract = require("@xyo-network/sentinel-abstract");
|
|
42
|
+
var import_axios2 = require("axios");
|
|
43
43
|
|
|
44
44
|
// src/util/toTokenRequest.ts
|
|
45
|
-
var toTokenRequest =
|
|
45
|
+
var toTokenRequest = (paymentCard, billingAddress) => {
|
|
46
46
|
const { cvv, expMonth, expYear, cardNumber } = paymentCard;
|
|
47
47
|
const { schema: _, ...fields } = billingAddress;
|
|
48
48
|
return {
|
|
49
|
-
billingAddress: {
|
|
50
|
-
...fields
|
|
51
|
-
},
|
|
49
|
+
billingAddress: { ...fields },
|
|
52
50
|
method: "payment-card",
|
|
53
|
-
paymentInstrument: {
|
|
54
|
-
cvv,
|
|
55
|
-
expMonth,
|
|
56
|
-
expYear,
|
|
57
|
-
pan: cardNumber
|
|
58
|
-
}
|
|
51
|
+
paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber }
|
|
59
52
|
};
|
|
60
|
-
}
|
|
53
|
+
};
|
|
61
54
|
|
|
62
55
|
// src/Sentinel.ts
|
|
63
|
-
var removePrefix =
|
|
56
|
+
var removePrefix = (str, prefix) => {
|
|
64
57
|
const regex = new RegExp(`^${prefix}`);
|
|
65
58
|
return str.replace(regex, "");
|
|
66
|
-
}
|
|
59
|
+
};
|
|
67
60
|
var moduleName = "RebillyPaymentCardAuthorizationSentinel";
|
|
68
61
|
var RebillyPaymentCardAuthorizationSentinel = class extends import_sentinel_abstract.AbstractSentinel {
|
|
69
|
-
static
|
|
70
|
-
__name(this, "RebillyPaymentCardAuthorizationSentinel");
|
|
71
|
-
}
|
|
72
|
-
static configSchemas = [
|
|
73
|
-
RebillyPaymentCardAuthorizationSentinelConfigSchema
|
|
74
|
-
];
|
|
62
|
+
static configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema];
|
|
75
63
|
static defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema;
|
|
76
64
|
_apiRoot = void 0;
|
|
77
65
|
_domain = void 0;
|
|
@@ -80,51 +68,54 @@ var RebillyPaymentCardAuthorizationSentinel = class extends import_sentinel_abst
|
|
|
80
68
|
_publishableApiKey = void 0;
|
|
81
69
|
_tokenEndpoint = void 0;
|
|
82
70
|
/**
|
|
83
|
-
|
|
84
|
-
|
|
71
|
+
* The Rebilly Organization API root endpoint
|
|
72
|
+
*/
|
|
85
73
|
get apiRoot() {
|
|
86
74
|
if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`;
|
|
87
75
|
return this._apiRoot;
|
|
88
76
|
}
|
|
89
77
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
78
|
+
* The Rebilly domain
|
|
79
|
+
*/
|
|
92
80
|
get domain() {
|
|
93
81
|
if (!this._domain) this._domain = (0, import_assert.assertEx)(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`);
|
|
94
82
|
return this._domain;
|
|
95
83
|
}
|
|
96
84
|
/**
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
* The headers to be included in the request for each request
|
|
86
|
+
*/
|
|
99
87
|
get headers() {
|
|
100
|
-
if (!this._headers) this._headers = {
|
|
101
|
-
Authorization: this.publishableApiKey
|
|
102
|
-
};
|
|
88
|
+
if (!this._headers) this._headers = { Authorization: this.publishableApiKey };
|
|
103
89
|
return this._headers;
|
|
104
90
|
}
|
|
105
91
|
/**
|
|
106
|
-
|
|
107
|
-
|
|
92
|
+
* True if the environment is sandbox (testing), false otherwise
|
|
93
|
+
*/
|
|
108
94
|
get isSandboxEnvironment() {
|
|
109
95
|
return this.domain.includes("sandbox");
|
|
110
96
|
}
|
|
111
97
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
98
|
+
* The Rebilly organization ID
|
|
99
|
+
*/
|
|
114
100
|
get organizationId() {
|
|
115
|
-
if (!this._organizationId)
|
|
101
|
+
if (!this._organizationId)
|
|
102
|
+
this._organizationId = removePrefix(
|
|
103
|
+
(0, import_assert.assertEx)(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),
|
|
104
|
+
"org_"
|
|
105
|
+
);
|
|
116
106
|
return this._organizationId;
|
|
117
107
|
}
|
|
118
108
|
/**
|
|
119
|
-
|
|
120
|
-
|
|
109
|
+
* The Rebilly Publishable API key
|
|
110
|
+
*/
|
|
121
111
|
get publishableApiKey() {
|
|
122
|
-
if (!this._publishableApiKey)
|
|
112
|
+
if (!this._publishableApiKey)
|
|
113
|
+
this._publishableApiKey = (0, import_assert.assertEx)(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`);
|
|
123
114
|
return this._publishableApiKey;
|
|
124
115
|
}
|
|
125
116
|
/**
|
|
126
|
-
|
|
127
|
-
|
|
117
|
+
* The Rebilly Organization token creation endpoint
|
|
118
|
+
*/
|
|
128
119
|
get tokenEndpoint() {
|
|
129
120
|
if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`;
|
|
130
121
|
return this._tokenEndpoint;
|
|
@@ -137,23 +128,14 @@ var RebillyPaymentCardAuthorizationSentinel = class extends import_sentinel_abst
|
|
|
137
128
|
if (!paymentCard) return results;
|
|
138
129
|
const billingAddress = payloads?.find(import_payment_payload_plugins.isBillingAddress);
|
|
139
130
|
if (!billingAddress) return results;
|
|
140
|
-
const axios = new import_axios.AxiosJson({
|
|
141
|
-
headers: this.headers
|
|
142
|
-
});
|
|
131
|
+
const axios = new import_axios.AxiosJson({ headers: this.headers });
|
|
143
132
|
try {
|
|
144
133
|
const data = toTokenRequest(paymentCard, billingAddress);
|
|
145
134
|
const response = await axios.post(this.tokenEndpoint, data);
|
|
146
|
-
(0, import_assert.assertEx)(response.status ===
|
|
135
|
+
(0, import_assert.assertEx)(response.status === import_axios2.HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`);
|
|
147
136
|
const { id } = response.data;
|
|
148
|
-
const sources = await import_payload_builder.PayloadBuilder.dataHashes([
|
|
149
|
-
|
|
150
|
-
billingAddress
|
|
151
|
-
]);
|
|
152
|
-
results.push({
|
|
153
|
-
id,
|
|
154
|
-
schema: import_rebilly_payment_payload_plugin.RebillyPaymentAuthorizationTokenSchema,
|
|
155
|
-
sources
|
|
156
|
-
});
|
|
137
|
+
const sources = await import_payload_builder.PayloadBuilder.dataHashes([paymentCard, billingAddress]);
|
|
138
|
+
results.push({ id, schema: import_rebilly_payment_payload_plugin.RebillyPaymentAuthorizationTokenSchema, sources });
|
|
157
139
|
} catch (error) {
|
|
158
140
|
this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`);
|
|
159
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Sentinel.ts","../../src/util/toTokenRequest.ts"],"sourcesContent":["export * from './Config.ts'\nexport * from './Params.ts'\nexport * from './Schema.ts'\nexport * from './Sentinel.ts'\n","export const RebillyPaymentCardAuthorizationSentinelSchema = 'network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly'\nexport type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema\n","import { RebillyApiDomainSettings } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { SentinelConfig } from '@xyo-network/sentinel-model'\n\nimport { RebillyPaymentCardAuthorizationSentinelSchema } from './Schema.ts'\n\nexport const RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`\nexport type RebillyPaymentCardAuthorizationSentinelConfigSchema = typeof RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n/*\n * The Rebilly Payment Card Authorization Sentinel Config\n */\nexport type RebillyPaymentCardAuthorizationSentinelConfig = SentinelConfig<{\n /**\n * The config schema\n */\n schema: RebillyPaymentCardAuthorizationSentinelConfigSchema\n}> &\nPartial<RebillyApiDomainSettings>\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson, AxiosRequestConfig, HttpStatusCode } from '@xylabs/axios'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isBillingAddress, isPaymentCard } from '@xyo-network/payment-payload-plugins'\nimport { RebillyPaymentAuthorizationToken, RebillyPaymentAuthorizationTokenSchema } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { AbstractSentinel } from '@xyo-network/sentinel-abstract'\nimport { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model'\n\nimport { CreateTokenResponse } from './Api/index.ts'\nimport { RebillyPaymentCardAuthorizationSentinelConfigSchema } from './Config.ts'\nimport { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts'\nimport { toTokenRequest } from './util/index.ts'\n\nconst removePrefix = (str: string, prefix: string) => {\n const regex = new RegExp(`^${prefix}`)\n return str.replace(regex, '')\n}\n\nconst moduleName = 'RebillyPaymentCardAuthorizationSentinel'\nexport class RebillyPaymentCardAuthorizationSentinel<\n TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema]\n static override defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n protected _apiRoot: string | undefined = undefined\n protected _domain: string | undefined = undefined\n protected _headers: AxiosRequestConfig['headers'] | undefined = undefined\n protected _organizationId: string | undefined = undefined\n protected _publishableApiKey: string | undefined = undefined\n protected _tokenEndpoint: string | undefined = undefined\n\n /**\n * The Rebilly Organization API root endpoint\n */\n protected get apiRoot() {\n if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`\n return this._apiRoot\n }\n\n /**\n * The Rebilly domain\n */\n protected get domain() {\n if (!this._domain) this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`)\n return this._domain\n }\n\n /**\n * The headers to be included in the request for each request\n */\n protected get headers(): AxiosRequestConfig['headers'] {\n if (!this._headers) this._headers = { Authorization: this.publishableApiKey }\n return this._headers\n }\n\n /**\n * True if the environment is sandbox (testing), false otherwise\n */\n protected get isSandboxEnvironment(): boolean {\n return this.domain.includes('sandbox')\n }\n\n /**\n * The Rebilly organization ID\n */\n protected get organizationId() {\n if (!this._organizationId)\n this._organizationId = removePrefix(\n assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),\n 'org_',\n )\n return this._organizationId\n }\n\n /**\n * The Rebilly Publishable API key\n */\n protected get publishableApiKey(): string {\n if (!this._publishableApiKey)\n this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`)\n return this._publishableApiKey\n }\n\n /**\n * The Rebilly Organization token creation endpoint\n */\n protected get tokenEndpoint() {\n if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`\n return this._tokenEndpoint\n }\n\n override async reportHandler(payloads?: Payload[]): Promise<Payload[]> {\n await this.started('throw')\n const results: WithSources<RebillyPaymentAuthorizationToken>[] = []\n // Verify necessary inputs and if nothing meets our criteria, bail early\n if (!payloads || payloads.length === 0) return results\n const paymentCard = payloads?.find(isPaymentCard)\n if (!paymentCard) return results\n const billingAddress = payloads?.find(isBillingAddress)\n if (!billingAddress) return results\n const axios = new AxiosJson({ headers: this.headers })\n try {\n const data = toTokenRequest(paymentCard, billingAddress)\n const response = await axios.post<CreateTokenResponse>(this.tokenEndpoint, data)\n assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`)\n const { id } = response.data\n const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])\n results.push({ id, schema: RebillyPaymentAuthorizationTokenSchema, sources })\n } catch (error) {\n this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`)\n }\n return results\n }\n}\n","import { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins'\n\nimport { CreatePaymentTokenRequest } from '../Api/index.ts'\n\n/**\n * Converts a payment card and billing address to a token request\n * @param paymentCard The payment card\n * @param billingAddress The billing address\n * @returns The token request\n */\nexport const toTokenRequest = (paymentCard: PaymentCard, billingAddress: BillingAddress): CreatePaymentTokenRequest => {\n const { cvv, expMonth, expYear, cardNumber } = paymentCard\n // NOTE: We are destructuring all but the schema and passing it along to the billingAddress. This\n // is to allow for missing fields to be omitted rather than set to undefined and for any new fields\n // that might be added later to be automatically picked up on. It is fine to pass this along since\n // the user is supplying this data about themselves.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { schema: _, ...fields } = billingAddress\n return {\n billingAddress: { ...fields },\n method: 'payment-card',\n paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;ACAO,IAAMA,gDAAgD;;;ACKtD,IAAMC,sDAAsD,GAAGC,6CAAAA;;;ACLtE,oBAAyB;AACzB,mBAA8D;AAC9D,6BAA+B;AAE/B,qCAAgD;AAChD,4CAAyF;AACzF,+BAAiC;;;ACI1B,IAAMC,iBAAiB,wBAACC,aAA0BC,mBAAAA;AACvD,QAAM,EAAEC,KAAKC,UAAUC,SAASC,WAAU,IAAKL;AAM/C,QAAM,EAAEM,QAAQC,GAAG,GAAGC,OAAAA,IAAWP;AACjC,SAAO;IACLA,gBAAgB;MAAE,GAAGO;IAAO;IAC5BC,QAAQ;IACRC,mBAAmB;MAAER;MAAKC;MAAUC;MAASO,KAAKN;IAAW;EAC/D;AACF,GAb8B;;;ADI9B,IAAMO,eAAe,wBAACC,KAAaC,WAAAA;AACjC,QAAMC,QAAQ,IAAIC,OAAO,IAAIF,MAAAA,EAAQ;AACrC,SAAOD,IAAII,QAAQF,OAAO,EAAA;AAC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;AACrE,UAAM,KAAKC,QAAQ,OAAA;AACnB,UAAMC,UAA2D,CAAA;AAEjE,QAAI,CAACF,YAAYA,SAASG,WAAW,EAAG,QAAOD;AAC/C,UAAME,cAAcJ,UAAUK,KAAKC,4CAAAA;AACnC,QAAI,CAACF,YAAa,QAAOF;AACzB,UAAMK,iBAAiBP,UAAUK,KAAKG,+CAAAA;AACtC,QAAI,CAACD,eAAgB,QAAOL;AAC5B,UAAMO,QAAQ,IAAIC,uBAAU;MAAEjB,SAAS,KAAKA;IAAQ,CAAA;AACpD,QAAI;AACF,YAAMkB,OAAOC,eAAeR,aAAaG,cAAAA;AACzC,YAAMM,WAAW,MAAMJ,MAAMK,KAA0B,KAAKhB,eAAea,IAAAA;AAC3ErB,kCAASuB,SAASE,WAAWC,4BAAeC,SAAS,MAAM,oCAAoCJ,SAASE,MAAM,EAAE;AAChH,YAAM,EAAEG,GAAE,IAAKL,SAASF;AACxB,YAAMQ,UAAU,MAAMC,sCAAeC,WAAW;QAACjB;QAAaG;OAAe;AAC7EL,cAAQoB,KAAK;QAAEJ;QAAIK,QAAQC;QAAwCL;MAAQ,CAAA;IAC7E,SAASM,OAAO;AACd,WAAKC,QAAQD,QAAQ,GAAGnD,UAAAA,mCAA6CmD,KAAAA,EAAO;IAC9E;AACA,WAAOvB;EACT;AACF;","names":["RebillyPaymentCardAuthorizationSentinelSchema","RebillyPaymentCardAuthorizationSentinelConfigSchema","RebillyPaymentCardAuthorizationSentinelSchema","toTokenRequest","paymentCard","billingAddress","cvv","expMonth","expYear","cardNumber","schema","_","fields","method","paymentInstrument","pan","removePrefix","str","prefix","regex","RegExp","replace","moduleName","RebillyPaymentCardAuthorizationSentinel","AbstractSentinel","configSchemas","RebillyPaymentCardAuthorizationSentinelConfigSchema","defaultConfigSchema","_apiRoot","undefined","_domain","_headers","_organizationId","_publishableApiKey","_tokenEndpoint","apiRoot","domain","organizationId","assertEx","params","config","headers","Authorization","publishableApiKey","isSandboxEnvironment","includes","tokenEndpoint","reportHandler","payloads","started","results","length","paymentCard","find","isPaymentCard","billingAddress","isBillingAddress","axios","AxiosJson","data","toTokenRequest","response","post","status","HttpStatusCode","Created","id","sources","PayloadBuilder","dataHashes","push","schema","RebillyPaymentAuthorizationTokenSchema","error","logger"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Sentinel.ts","../../src/util/toTokenRequest.ts"],"sourcesContent":["export * from './Config.ts'\nexport * from './Params.ts'\nexport * from './Schema.ts'\nexport * from './Sentinel.ts'\n","export const RebillyPaymentCardAuthorizationSentinelSchema = 'network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly'\nexport type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema\n","import { RebillyApiDomainSettings } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { SentinelConfig } from '@xyo-network/sentinel-model'\n\nimport { RebillyPaymentCardAuthorizationSentinelSchema } from './Schema.ts'\n\nexport const RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`\nexport type RebillyPaymentCardAuthorizationSentinelConfigSchema = typeof RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n/*\n * The Rebilly Payment Card Authorization Sentinel Config\n */\nexport type RebillyPaymentCardAuthorizationSentinelConfig = SentinelConfig<{\n /**\n * The config schema\n */\n schema: RebillyPaymentCardAuthorizationSentinelConfigSchema\n}> &\nPartial<RebillyApiDomainSettings>\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isBillingAddress, isPaymentCard } from '@xyo-network/payment-payload-plugins'\nimport { RebillyPaymentAuthorizationToken, RebillyPaymentAuthorizationTokenSchema } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { AbstractSentinel } from '@xyo-network/sentinel-abstract'\nimport { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model'\nimport { AxiosRequestConfig, HttpStatusCode } from 'axios'\n\nimport { CreateTokenResponse } from './Api/index.ts'\nimport { RebillyPaymentCardAuthorizationSentinelConfigSchema } from './Config.ts'\nimport { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts'\nimport { toTokenRequest } from './util/index.ts'\n\nconst removePrefix = (str: string, prefix: string) => {\n const regex = new RegExp(`^${prefix}`)\n return str.replace(regex, '')\n}\n\nconst moduleName = 'RebillyPaymentCardAuthorizationSentinel'\nexport class RebillyPaymentCardAuthorizationSentinel<\n TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema]\n static override defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n protected _apiRoot: string | undefined = undefined\n protected _domain: string | undefined = undefined\n protected _headers: AxiosRequestConfig['headers'] | undefined = undefined\n protected _organizationId: string | undefined = undefined\n protected _publishableApiKey: string | undefined = undefined\n protected _tokenEndpoint: string | undefined = undefined\n\n /**\n * The Rebilly Organization API root endpoint\n */\n protected get apiRoot() {\n if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`\n return this._apiRoot\n }\n\n /**\n * The Rebilly domain\n */\n protected get domain() {\n if (!this._domain) this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`)\n return this._domain\n }\n\n /**\n * The headers to be included in the request for each request\n */\n protected get headers(): AxiosRequestConfig['headers'] {\n if (!this._headers) this._headers = { Authorization: this.publishableApiKey }\n return this._headers\n }\n\n /**\n * True if the environment is sandbox (testing), false otherwise\n */\n protected get isSandboxEnvironment(): boolean {\n return this.domain.includes('sandbox')\n }\n\n /**\n * The Rebilly organization ID\n */\n protected get organizationId() {\n if (!this._organizationId)\n this._organizationId = removePrefix(\n assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),\n 'org_',\n )\n return this._organizationId\n }\n\n /**\n * The Rebilly Publishable API key\n */\n protected get publishableApiKey(): string {\n if (!this._publishableApiKey)\n this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`)\n return this._publishableApiKey\n }\n\n /**\n * The Rebilly Organization token creation endpoint\n */\n protected get tokenEndpoint() {\n if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`\n return this._tokenEndpoint\n }\n\n override async reportHandler(payloads?: Payload[]): Promise<Payload[]> {\n await this.started('throw')\n const results: WithSources<RebillyPaymentAuthorizationToken>[] = []\n // Verify necessary inputs and if nothing meets our criteria, bail early\n if (!payloads || payloads.length === 0) return results\n const paymentCard = payloads?.find(isPaymentCard)\n if (!paymentCard) return results\n const billingAddress = payloads?.find(isBillingAddress)\n if (!billingAddress) return results\n const axios = new AxiosJson({ headers: this.headers })\n try {\n const data = toTokenRequest(paymentCard, billingAddress)\n const response = await axios.post<CreateTokenResponse>(this.tokenEndpoint, data)\n assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`)\n const { id } = response.data\n const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])\n results.push({ id, schema: RebillyPaymentAuthorizationTokenSchema, sources })\n } catch (error) {\n this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`)\n }\n return results\n }\n}\n","import { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins'\n\nimport { CreatePaymentTokenRequest } from '../Api/index.ts'\n\n/**\n * Converts a payment card and billing address to a token request\n * @param paymentCard The payment card\n * @param billingAddress The billing address\n * @returns The token request\n */\nexport const toTokenRequest = (paymentCard: PaymentCard, billingAddress: BillingAddress): CreatePaymentTokenRequest => {\n const { cvv, expMonth, expYear, cardNumber } = paymentCard\n // NOTE: We are destructuring all but the schema and passing it along to the billingAddress. This\n // is to allow for missing fields to be omitted rather than set to undefined and for any new fields\n // that might be added later to be automatically picked up on. It is fine to pass this along since\n // the user is supplying this data about themselves.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { schema: _, ...fields } = billingAddress\n return {\n billingAddress: { ...fields },\n method: 'payment-card',\n paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,gDAAgD;;;ACKtD,IAAM,sDAAsD,GAAG,6CAA6C;;;ACLnH,oBAAyB;AACzB,mBAA0B;AAC1B,6BAA+B;AAE/B,qCAAgD;AAChD,4CAAyF;AACzF,+BAAiC;AAEjC,IAAAA,gBAAmD;;;ACE5C,IAAM,iBAAiB,CAAC,aAA0B,mBAA8D;AACrH,QAAM,EAAE,KAAK,UAAU,SAAS,WAAW,IAAI;AAM/C,QAAM,EAAE,QAAQ,GAAG,GAAG,OAAO,IAAI;AACjC,SAAO;AAAA,IACL,gBAAgB,EAAE,GAAG,OAAO;AAAA,IAC5B,QAAQ;AAAA,IACR,mBAAmB,EAAE,KAAK,UAAU,SAAS,KAAK,WAAW;AAAA,EAC/D;AACF;;;ADRA,IAAM,eAAe,CAAC,KAAa,WAAmB;AACpD,QAAM,QAAQ,IAAI,OAAO,IAAI,MAAM,EAAE;AACrC,SAAO,IAAI,QAAQ,OAAO,EAAE;AAC9B;AAEA,IAAM,aAAa;AACZ,IAAM,0CAAN,cAGG,0CAAsC;AAAA,EAC9C,OAAgB,gBAAgB,CAAC,mDAAmD;AAAA,EACpF,OAAgB,sBAAsB;AAAA,EAE5B,WAA+B;AAAA,EAC/B,UAA8B;AAAA,EAC9B,WAAsD;AAAA,EACtD,kBAAsC;AAAA,EACtC,qBAAyC;AAAA,EACzC,iBAAqC;AAAA;AAAA;AAAA;AAAA,EAK/C,IAAc,UAAU;AACtB,QAAI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YAAa,QAAO;AACzB,UAAM,iBAAiB,UAAU,KAAK,+CAAgB;AACtD,QAAI,CAAC,eAAgB,QAAO;AAC5B,UAAM,QAAQ,IAAI,uBAAU,EAAE,SAAS,KAAK,QAAQ,CAAC;AACrD,QAAI;AACF,YAAM,OAAO,eAAe,aAAa,cAAc;AACvD,YAAM,WAAW,MAAM,MAAM,KAA0B,KAAK,eAAe,IAAI;AAC/E,kCAAS,SAAS,WAAW,6BAAe,SAAS,MAAM,oCAAoC,SAAS,MAAM,EAAE;AAChH,YAAM,EAAE,GAAG,IAAI,SAAS;AACxB,YAAM,UAAU,MAAM,sCAAe,WAAW,CAAC,aAAa,cAAc,CAAC;AAC7E,cAAQ,KAAK,EAAE,IAAI,QAAQ,8EAAwC,QAAQ,CAAC;AAAA,IAC9E,SAAS,OAAO;AACd,WAAK,QAAQ,QAAQ,GAAG,UAAU,mCAAmC,KAAK,EAAE;AAAA,IAC9E;AACA,WAAO;AAAA,EACT;AACF;","names":["import_axios"]}
|
package/dist/browser/index.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/Schema.ts
|
|
5
2
|
var RebillyPaymentCardAuthorizationSentinelSchema = "network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly";
|
|
6
3
|
|
|
@@ -9,43 +6,32 @@ var RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardA
|
|
|
9
6
|
|
|
10
7
|
// src/Sentinel.ts
|
|
11
8
|
import { assertEx } from "@xylabs/assert";
|
|
12
|
-
import { AxiosJson
|
|
9
|
+
import { AxiosJson } from "@xylabs/axios";
|
|
13
10
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
14
11
|
import { isBillingAddress, isPaymentCard } from "@xyo-network/payment-payload-plugins";
|
|
15
12
|
import { RebillyPaymentAuthorizationTokenSchema } from "@xyo-network/rebilly-payment-payload-plugin";
|
|
16
13
|
import { AbstractSentinel } from "@xyo-network/sentinel-abstract";
|
|
14
|
+
import { HttpStatusCode } from "axios";
|
|
17
15
|
|
|
18
16
|
// src/util/toTokenRequest.ts
|
|
19
|
-
var toTokenRequest =
|
|
17
|
+
var toTokenRequest = (paymentCard, billingAddress) => {
|
|
20
18
|
const { cvv, expMonth, expYear, cardNumber } = paymentCard;
|
|
21
19
|
const { schema: _, ...fields } = billingAddress;
|
|
22
20
|
return {
|
|
23
|
-
billingAddress: {
|
|
24
|
-
...fields
|
|
25
|
-
},
|
|
21
|
+
billingAddress: { ...fields },
|
|
26
22
|
method: "payment-card",
|
|
27
|
-
paymentInstrument: {
|
|
28
|
-
cvv,
|
|
29
|
-
expMonth,
|
|
30
|
-
expYear,
|
|
31
|
-
pan: cardNumber
|
|
32
|
-
}
|
|
23
|
+
paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber }
|
|
33
24
|
};
|
|
34
|
-
}
|
|
25
|
+
};
|
|
35
26
|
|
|
36
27
|
// src/Sentinel.ts
|
|
37
|
-
var removePrefix =
|
|
28
|
+
var removePrefix = (str, prefix) => {
|
|
38
29
|
const regex = new RegExp(`^${prefix}`);
|
|
39
30
|
return str.replace(regex, "");
|
|
40
|
-
}
|
|
31
|
+
};
|
|
41
32
|
var moduleName = "RebillyPaymentCardAuthorizationSentinel";
|
|
42
33
|
var RebillyPaymentCardAuthorizationSentinel = class extends AbstractSentinel {
|
|
43
|
-
static
|
|
44
|
-
__name(this, "RebillyPaymentCardAuthorizationSentinel");
|
|
45
|
-
}
|
|
46
|
-
static configSchemas = [
|
|
47
|
-
RebillyPaymentCardAuthorizationSentinelConfigSchema
|
|
48
|
-
];
|
|
34
|
+
static configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema];
|
|
49
35
|
static defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema;
|
|
50
36
|
_apiRoot = void 0;
|
|
51
37
|
_domain = void 0;
|
|
@@ -54,51 +40,54 @@ var RebillyPaymentCardAuthorizationSentinel = class extends AbstractSentinel {
|
|
|
54
40
|
_publishableApiKey = void 0;
|
|
55
41
|
_tokenEndpoint = void 0;
|
|
56
42
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
* The Rebilly Organization API root endpoint
|
|
44
|
+
*/
|
|
59
45
|
get apiRoot() {
|
|
60
46
|
if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`;
|
|
61
47
|
return this._apiRoot;
|
|
62
48
|
}
|
|
63
49
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
* The Rebilly domain
|
|
51
|
+
*/
|
|
66
52
|
get domain() {
|
|
67
53
|
if (!this._domain) this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`);
|
|
68
54
|
return this._domain;
|
|
69
55
|
}
|
|
70
56
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
57
|
+
* The headers to be included in the request for each request
|
|
58
|
+
*/
|
|
73
59
|
get headers() {
|
|
74
|
-
if (!this._headers) this._headers = {
|
|
75
|
-
Authorization: this.publishableApiKey
|
|
76
|
-
};
|
|
60
|
+
if (!this._headers) this._headers = { Authorization: this.publishableApiKey };
|
|
77
61
|
return this._headers;
|
|
78
62
|
}
|
|
79
63
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
64
|
+
* True if the environment is sandbox (testing), false otherwise
|
|
65
|
+
*/
|
|
82
66
|
get isSandboxEnvironment() {
|
|
83
67
|
return this.domain.includes("sandbox");
|
|
84
68
|
}
|
|
85
69
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
* The Rebilly organization ID
|
|
71
|
+
*/
|
|
88
72
|
get organizationId() {
|
|
89
|
-
if (!this._organizationId)
|
|
73
|
+
if (!this._organizationId)
|
|
74
|
+
this._organizationId = removePrefix(
|
|
75
|
+
assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),
|
|
76
|
+
"org_"
|
|
77
|
+
);
|
|
90
78
|
return this._organizationId;
|
|
91
79
|
}
|
|
92
80
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
81
|
+
* The Rebilly Publishable API key
|
|
82
|
+
*/
|
|
95
83
|
get publishableApiKey() {
|
|
96
|
-
if (!this._publishableApiKey)
|
|
84
|
+
if (!this._publishableApiKey)
|
|
85
|
+
this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`);
|
|
97
86
|
return this._publishableApiKey;
|
|
98
87
|
}
|
|
99
88
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
89
|
+
* The Rebilly Organization token creation endpoint
|
|
90
|
+
*/
|
|
102
91
|
get tokenEndpoint() {
|
|
103
92
|
if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`;
|
|
104
93
|
return this._tokenEndpoint;
|
|
@@ -111,23 +100,14 @@ var RebillyPaymentCardAuthorizationSentinel = class extends AbstractSentinel {
|
|
|
111
100
|
if (!paymentCard) return results;
|
|
112
101
|
const billingAddress = payloads?.find(isBillingAddress);
|
|
113
102
|
if (!billingAddress) return results;
|
|
114
|
-
const axios = new AxiosJson({
|
|
115
|
-
headers: this.headers
|
|
116
|
-
});
|
|
103
|
+
const axios = new AxiosJson({ headers: this.headers });
|
|
117
104
|
try {
|
|
118
105
|
const data = toTokenRequest(paymentCard, billingAddress);
|
|
119
106
|
const response = await axios.post(this.tokenEndpoint, data);
|
|
120
107
|
assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`);
|
|
121
108
|
const { id } = response.data;
|
|
122
|
-
const sources = await PayloadBuilder.dataHashes([
|
|
123
|
-
|
|
124
|
-
billingAddress
|
|
125
|
-
]);
|
|
126
|
-
results.push({
|
|
127
|
-
id,
|
|
128
|
-
schema: RebillyPaymentAuthorizationTokenSchema,
|
|
129
|
-
sources
|
|
130
|
-
});
|
|
109
|
+
const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress]);
|
|
110
|
+
results.push({ id, schema: RebillyPaymentAuthorizationTokenSchema, sources });
|
|
131
111
|
} catch (error) {
|
|
132
112
|
this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`);
|
|
133
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Sentinel.ts","../../src/util/toTokenRequest.ts"],"sourcesContent":["export const RebillyPaymentCardAuthorizationSentinelSchema = 'network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly'\nexport type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema\n","import { RebillyApiDomainSettings } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { SentinelConfig } from '@xyo-network/sentinel-model'\n\nimport { RebillyPaymentCardAuthorizationSentinelSchema } from './Schema.ts'\n\nexport const RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`\nexport type RebillyPaymentCardAuthorizationSentinelConfigSchema = typeof RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n/*\n * The Rebilly Payment Card Authorization Sentinel Config\n */\nexport type RebillyPaymentCardAuthorizationSentinelConfig = SentinelConfig<{\n /**\n * The config schema\n */\n schema: RebillyPaymentCardAuthorizationSentinelConfigSchema\n}> &\nPartial<RebillyApiDomainSettings>\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson, AxiosRequestConfig, HttpStatusCode } from '@xylabs/axios'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isBillingAddress, isPaymentCard } from '@xyo-network/payment-payload-plugins'\nimport { RebillyPaymentAuthorizationToken, RebillyPaymentAuthorizationTokenSchema } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { AbstractSentinel } from '@xyo-network/sentinel-abstract'\nimport { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model'\n\nimport { CreateTokenResponse } from './Api/index.ts'\nimport { RebillyPaymentCardAuthorizationSentinelConfigSchema } from './Config.ts'\nimport { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts'\nimport { toTokenRequest } from './util/index.ts'\n\nconst removePrefix = (str: string, prefix: string) => {\n const regex = new RegExp(`^${prefix}`)\n return str.replace(regex, '')\n}\n\nconst moduleName = 'RebillyPaymentCardAuthorizationSentinel'\nexport class RebillyPaymentCardAuthorizationSentinel<\n TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema]\n static override defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n protected _apiRoot: string | undefined = undefined\n protected _domain: string | undefined = undefined\n protected _headers: AxiosRequestConfig['headers'] | undefined = undefined\n protected _organizationId: string | undefined = undefined\n protected _publishableApiKey: string | undefined = undefined\n protected _tokenEndpoint: string | undefined = undefined\n\n /**\n * The Rebilly Organization API root endpoint\n */\n protected get apiRoot() {\n if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`\n return this._apiRoot\n }\n\n /**\n * The Rebilly domain\n */\n protected get domain() {\n if (!this._domain) this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`)\n return this._domain\n }\n\n /**\n * The headers to be included in the request for each request\n */\n protected get headers(): AxiosRequestConfig['headers'] {\n if (!this._headers) this._headers = { Authorization: this.publishableApiKey }\n return this._headers\n }\n\n /**\n * True if the environment is sandbox (testing), false otherwise\n */\n protected get isSandboxEnvironment(): boolean {\n return this.domain.includes('sandbox')\n }\n\n /**\n * The Rebilly organization ID\n */\n protected get organizationId() {\n if (!this._organizationId)\n this._organizationId = removePrefix(\n assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),\n 'org_',\n )\n return this._organizationId\n }\n\n /**\n * The Rebilly Publishable API key\n */\n protected get publishableApiKey(): string {\n if (!this._publishableApiKey)\n this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`)\n return this._publishableApiKey\n }\n\n /**\n * The Rebilly Organization token creation endpoint\n */\n protected get tokenEndpoint() {\n if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`\n return this._tokenEndpoint\n }\n\n override async reportHandler(payloads?: Payload[]): Promise<Payload[]> {\n await this.started('throw')\n const results: WithSources<RebillyPaymentAuthorizationToken>[] = []\n // Verify necessary inputs and if nothing meets our criteria, bail early\n if (!payloads || payloads.length === 0) return results\n const paymentCard = payloads?.find(isPaymentCard)\n if (!paymentCard) return results\n const billingAddress = payloads?.find(isBillingAddress)\n if (!billingAddress) return results\n const axios = new AxiosJson({ headers: this.headers })\n try {\n const data = toTokenRequest(paymentCard, billingAddress)\n const response = await axios.post<CreateTokenResponse>(this.tokenEndpoint, data)\n assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`)\n const { id } = response.data\n const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])\n results.push({ id, schema: RebillyPaymentAuthorizationTokenSchema, sources })\n } catch (error) {\n this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`)\n }\n return results\n }\n}\n","import { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins'\n\nimport { CreatePaymentTokenRequest } from '../Api/index.ts'\n\n/**\n * Converts a payment card and billing address to a token request\n * @param paymentCard The payment card\n * @param billingAddress The billing address\n * @returns The token request\n */\nexport const toTokenRequest = (paymentCard: PaymentCard, billingAddress: BillingAddress): CreatePaymentTokenRequest => {\n const { cvv, expMonth, expYear, cardNumber } = paymentCard\n // NOTE: We are destructuring all but the schema and passing it along to the billingAddress. This\n // is to allow for missing fields to be omitted rather than set to undefined and for any new fields\n // that might be added later to be automatically picked up on. It is fine to pass this along since\n // the user is supplying this data about themselves.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { schema: _, ...fields } = billingAddress\n return {\n billingAddress: { ...fields },\n method: 'payment-card',\n paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber },\n }\n}\n"],"mappings":";;;;AAAO,IAAMA,gDAAgD;;;ACKtD,IAAMC,sDAAsD,GAAGC,6CAAAA;;;ACLtE,SAASC,gBAAgB;AACzB,SAASC,WAA+BC,sBAAsB;AAC9D,SAASC,sBAAsB;AAE/B,SAASC,kBAAkBC,qBAAqB;AAChD,SAA2CC,8CAA8C;AACzF,SAASC,wBAAwB;;;ACI1B,IAAMC,iBAAiB,wBAACC,aAA0BC,mBAAAA;AACvD,QAAM,EAAEC,KAAKC,UAAUC,SAASC,WAAU,IAAKL;AAM/C,QAAM,EAAEM,QAAQC,GAAG,GAAGC,OAAAA,IAAWP;AACjC,SAAO;IACLA,gBAAgB;MAAE,GAAGO;IAAO;IAC5BC,QAAQ;IACRC,mBAAmB;MAAER;MAAKC;MAAUC;MAASO,KAAKN;IAAW;EAC/D;AACF,GAb8B;;;ADI9B,IAAMO,eAAe,wBAACC,KAAaC,WAAAA;AACjC,QAAMC,QAAQ,IAAIC,OAAO,IAAIF,MAAAA,EAAQ;AACrC,SAAOD,IAAII,QAAQF,OAAO,EAAA;AAC5B,GAHqB;AAKrB,IAAMG,aAAa;AACZ,IAAMC,0CAAN,cAGGC,iBAAAA;EAvBV,OAuBUA;;;EACR,OAAgBC,gBAAgB;IAACC;;EACjC,OAAgBC,sBAAsBD;EAE5BE,WAA+BC;EAC/BC,UAA8BD;EAC9BE,WAAsDF;EACtDG,kBAAsCH;EACtCI,qBAAyCJ;EACzCK,iBAAqCL;;;;EAK/C,IAAcM,UAAU;AACtB,QAAI,CAAC,KAAKP,SAAU,MAAKA,WAAW,GAAG,KAAKQ,MAAM,kBAAkB,KAAKC,cAAc;AACvF,WAAO,KAAKT;EACd;;;;EAKA,IAAcQ,SA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,WAAW,MAAMJ,MAAMK,KAA0B,KAAKhB,eAAea,IAAAA;AAC3ErB,eAASuB,SAASE,WAAWC,eAAeC,SAAS,MAAM,oCAAoCJ,SAASE,MAAM,EAAE;AAChH,YAAM,EAAEG,GAAE,IAAKL,SAASF;AACxB,YAAMQ,UAAU,MAAMC,eAAeC,WAAW;QAACjB;QAAaG;OAAe;AAC7EL,cAAQoB,KAAK;QAAEJ;QAAIK,QAAQC;QAAwCL;MAAQ,CAAA;IAC7E,SAASM,OAAO;AACd,WAAKC,QAAQD,QAAQ,GAAGnD,UAAAA,mCAA6CmD,KAAAA,EAAO;IAC9E;AACA,WAAOvB;EACT;AACF;","names":["RebillyPaymentCardAuthorizationSentinelSchema","RebillyPaymentCardAuthorizationSentinelConfigSchema","RebillyPaymentCardAuthorizationSentinelSchema","assertEx","AxiosJson","HttpStatusCode","PayloadBuilder","isBillingAddress","isPaymentCard","RebillyPaymentAuthorizationTokenSchema","AbstractSentinel","toTokenRequest","paymentCard","billingAddress","cvv","expMonth","expYear","cardNumber","schema","_","fields","method","paymentInstrument","pan","removePrefix","str","prefix","regex","RegExp","replace","moduleName","RebillyPaymentCardAuthorizationSentinel","AbstractSentinel","configSchemas","RebillyPaymentCardAuthorizationSentinelConfigSchema","defaultConfigSchema","_apiRoot","undefined","_domain","_headers","_organizationId","_publishableApiKey","_tokenEndpoint","apiRoot","domain","organizationId","assertEx","params","config","headers","Authorization","publishableApiKey","isSandboxEnvironment","includes","tokenEndpoint","reportHandler","payloads","started","results","length","paymentCard","find","isPaymentCard","billingAddress","isBillingAddress","axios","AxiosJson","data","toTokenRequest","response","post","status","HttpStatusCode","Created","id","sources","PayloadBuilder","dataHashes","push","schema","RebillyPaymentAuthorizationTokenSchema","error","logger"]}
|
|
1
|
+
{"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Sentinel.ts","../../src/util/toTokenRequest.ts"],"sourcesContent":["export const RebillyPaymentCardAuthorizationSentinelSchema = 'network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly'\nexport type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema\n","import { RebillyApiDomainSettings } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { SentinelConfig } from '@xyo-network/sentinel-model'\n\nimport { RebillyPaymentCardAuthorizationSentinelSchema } from './Schema.ts'\n\nexport const RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`\nexport type RebillyPaymentCardAuthorizationSentinelConfigSchema = typeof RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n/*\n * The Rebilly Payment Card Authorization Sentinel Config\n */\nexport type RebillyPaymentCardAuthorizationSentinelConfig = SentinelConfig<{\n /**\n * The config schema\n */\n schema: RebillyPaymentCardAuthorizationSentinelConfigSchema\n}> &\nPartial<RebillyApiDomainSettings>\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isBillingAddress, isPaymentCard } from '@xyo-network/payment-payload-plugins'\nimport { RebillyPaymentAuthorizationToken, RebillyPaymentAuthorizationTokenSchema } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { AbstractSentinel } from '@xyo-network/sentinel-abstract'\nimport { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model'\nimport { AxiosRequestConfig, HttpStatusCode } from 'axios'\n\nimport { CreateTokenResponse } from './Api/index.ts'\nimport { RebillyPaymentCardAuthorizationSentinelConfigSchema } from './Config.ts'\nimport { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts'\nimport { toTokenRequest } from './util/index.ts'\n\nconst removePrefix = (str: string, prefix: string) => {\n const regex = new RegExp(`^${prefix}`)\n return str.replace(regex, '')\n}\n\nconst moduleName = 'RebillyPaymentCardAuthorizationSentinel'\nexport class RebillyPaymentCardAuthorizationSentinel<\n TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema]\n static override defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n protected _apiRoot: string | undefined = undefined\n protected _domain: string | undefined = undefined\n protected _headers: AxiosRequestConfig['headers'] | undefined = undefined\n protected _organizationId: string | undefined = undefined\n protected _publishableApiKey: string | undefined = undefined\n protected _tokenEndpoint: string | undefined = undefined\n\n /**\n * The Rebilly Organization API root endpoint\n */\n protected get apiRoot() {\n if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`\n return this._apiRoot\n }\n\n /**\n * The Rebilly domain\n */\n protected get domain() {\n if (!this._domain) this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`)\n return this._domain\n }\n\n /**\n * The headers to be included in the request for each request\n */\n protected get headers(): AxiosRequestConfig['headers'] {\n if (!this._headers) this._headers = { Authorization: this.publishableApiKey }\n return this._headers\n }\n\n /**\n * True if the environment is sandbox (testing), false otherwise\n */\n protected get isSandboxEnvironment(): boolean {\n return this.domain.includes('sandbox')\n }\n\n /**\n * The Rebilly organization ID\n */\n protected get organizationId() {\n if (!this._organizationId)\n this._organizationId = removePrefix(\n assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),\n 'org_',\n )\n return this._organizationId\n }\n\n /**\n * The Rebilly Publishable API key\n */\n protected get publishableApiKey(): string {\n if (!this._publishableApiKey)\n this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`)\n return this._publishableApiKey\n }\n\n /**\n * The Rebilly Organization token creation endpoint\n */\n protected get tokenEndpoint() {\n if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`\n return this._tokenEndpoint\n }\n\n override async reportHandler(payloads?: Payload[]): Promise<Payload[]> {\n await this.started('throw')\n const results: WithSources<RebillyPaymentAuthorizationToken>[] = []\n // Verify necessary inputs and if nothing meets our criteria, bail early\n if (!payloads || payloads.length === 0) return results\n const paymentCard = payloads?.find(isPaymentCard)\n if (!paymentCard) return results\n const billingAddress = payloads?.find(isBillingAddress)\n if (!billingAddress) return results\n const axios = new AxiosJson({ headers: this.headers })\n try {\n const data = toTokenRequest(paymentCard, billingAddress)\n const response = await axios.post<CreateTokenResponse>(this.tokenEndpoint, data)\n assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`)\n const { id } = response.data\n const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])\n results.push({ id, schema: RebillyPaymentAuthorizationTokenSchema, sources })\n } catch (error) {\n this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`)\n }\n return results\n }\n}\n","import { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins'\n\nimport { CreatePaymentTokenRequest } from '../Api/index.ts'\n\n/**\n * Converts a payment card and billing address to a token request\n * @param paymentCard The payment card\n * @param billingAddress The billing address\n * @returns The token request\n */\nexport const toTokenRequest = (paymentCard: PaymentCard, billingAddress: BillingAddress): CreatePaymentTokenRequest => {\n const { cvv, expMonth, expYear, cardNumber } = paymentCard\n // NOTE: We are destructuring all but the schema and passing it along to the billingAddress. This\n // is to allow for missing fields to be omitted rather than set to undefined and for any new fields\n // that might be added later to be automatically picked up on. It is fine to pass this along since\n // the user is supplying this data about themselves.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { schema: _, ...fields } = billingAddress\n return {\n billingAddress: { ...fields },\n method: 'payment-card',\n paymentInstrument: { cvv, expMonth, expYear, pan: cardNumber },\n }\n}\n"],"mappings":";AAAO,IAAM,gDAAgD;;;ACKtD,IAAM,sDAAsD,GAAG,6CAA6C;;;ACLnH,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB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7E,cAAQ,KAAK,EAAE,IAAI,QAAQ,wCAAwC,QAAQ,CAAC;AAAA,IAC9E,SAAS,OAAO;AACd,WAAK,QAAQ,QAAQ,GAAG,UAAU,mCAAmC,KAAK,EAAE;AAAA,IAC9E;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from '@xylabs/axios';
|
|
2
1
|
import { Payload } from '@xyo-network/payload-model';
|
|
3
2
|
import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
|
|
4
3
|
import { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model';
|
|
4
|
+
import { AxiosRequestConfig } from 'axios';
|
|
5
5
|
import { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts';
|
|
6
6
|
export declare class RebillyPaymentCardAuthorizationSentinel<TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
|
|
7
7
|
static configSchemas: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAkB,MAAM,OAAO,CAAA;AAI1D,OAAO,EAAE,6CAA6C,EAAE,MAAM,aAAa,CAAA;AAS3E,qBAAa,uCAAuC,CAClD,OAAO,SAAS,6CAA6C,GAAG,6CAA6C,EAC7G,UAAU,SAAS,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAC1H,SAAQ,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7C,OAAgB,aAAa,WAAwD;IACrF,OAAgB,mBAAmB,SAAsD;IAEzF,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAY;IAClD,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAY;IACjD,SAAS,CAAC,QAAQ,EAAE,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAY;IACzE,SAAS,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAY;IACzD,SAAS,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAY;IAC5D,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAY;IAKxD,SAAS,KAAK,OAAO,WAGpB;IAKD,SAAS,KAAK,MAAM,WAGnB;IAKD,SAAS,KAAK,OAAO,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAGrD;IAKD,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAKD,SAAS,KAAK,cAAc,WAO3B;IAKD,SAAS,KAAK,iBAAiB,IAAI,MAAM,CAIxC;IAKD,SAAS,KAAK,aAAa,WAG1B;IAEc,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAsBvE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from '@xylabs/axios';
|
|
2
1
|
import { Payload } from '@xyo-network/payload-model';
|
|
3
2
|
import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
|
|
4
3
|
import { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model';
|
|
4
|
+
import { AxiosRequestConfig } from 'axios';
|
|
5
5
|
import { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts';
|
|
6
6
|
export declare class RebillyPaymentCardAuthorizationSentinel<TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
|
|
7
7
|
static configSchemas: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAkB,MAAM,OAAO,CAAA;AAI1D,OAAO,EAAE,6CAA6C,EAAE,MAAM,aAAa,CAAA;AAS3E,qBAAa,uCAAuC,CAClD,OAAO,SAAS,6CAA6C,GAAG,6CAA6C,EAC7G,UAAU,SAAS,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAC1H,SAAQ,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7C,OAAgB,aAAa,WAAwD;IACrF,OAAgB,mBAAmB,SAAsD;IAEzF,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAY;IAClD,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAY;IACjD,SAAS,CAAC,QAAQ,EAAE,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAY;IACzE,SAAS,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAY;IACzD,SAAS,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAY;IAC5D,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAY;IAKxD,SAAS,KAAK,OAAO,WAGpB;IAKD,SAAS,KAAK,MAAM,WAGnB;IAKD,SAAS,KAAK,OAAO,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAGrD;IAKD,SAAS,KAAK,oBAAoB,IAAI,OAAO,CAE5C;IAKD,SAAS,KAAK,cAAc,WAO3B;IAKD,SAAS,KAAK,iBAAiB,IAAI,MAAM,CAIxC;IAKD,SAAS,KAAK,aAAa,WAG1B;IAEc,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAsBvE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from '@xylabs/axios';
|
|
2
1
|
import { Payload } from '@xyo-network/payload-model';
|
|
3
2
|
import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
|
|
4
3
|
import { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model';
|
|
4
|
+
import { AxiosRequestConfig } from 'axios';
|
|
5
5
|
import { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts';
|
|
6
6
|
export declare class RebillyPaymentCardAuthorizationSentinel<TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
|
|
7
7
|
static configSchemas: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sentinel.d.ts","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":"AAGA,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