@activepieces/piece-recurly 0.0.3 → 0.0.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/package.json +7 -13
- package/src/index.js +13 -39
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-account.d.ts +0 -8
- package/src/lib/actions/create-account.d.ts.map +0 -1
- package/src/lib/actions/create-account.js +0 -60
- package/src/lib/actions/create-account.js.map +0 -1
- package/src/lib/actions/create-subscription.d.ts +0 -7
- package/src/lib/actions/create-subscription.d.ts.map +0 -1
- package/src/lib/actions/create-subscription.js +0 -51
- package/src/lib/actions/create-subscription.js.map +0 -1
- package/src/lib/actions/get-account.d.ts +0 -4
- package/src/lib/actions/get-account.d.ts.map +0 -1
- package/src/lib/actions/get-account.js +0 -29
- package/src/lib/actions/get-account.js.map +0 -1
- package/src/lib/actions/list-subscriptions.d.ts +0 -6
- package/src/lib/actions/list-subscriptions.d.ts.map +0 -1
- package/src/lib/actions/list-subscriptions.js +0 -79
- package/src/lib/actions/list-subscriptions.js.map +0 -1
- package/src/lib/auth.d.ts +0 -4
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -25
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -11
- package/src/lib/common/client.d.ts.map +0 -1
- package/src/lib/common/client.js +0 -80
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -3
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -132
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/common/utils.d.ts +0 -6
- package/src/lib/common/utils.d.ts.map +0 -1
- package/src/lib/common/utils.js +0 -90
- package/src/lib/common/utils.js.map +0 -1
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AAErD,iEAAmE;AACnE,2EAA6E;AAC7E,2DAA6D;AAC7D,yEAA2E;AAC3E,qCAAyC;AAE5B,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,6EAA6E;IAC/E,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,UAAU,EAAE,CAAC,sBAAa,CAAC,QAAQ,EAAE,sBAAa,CAAC,kBAAkB,CAAC;IACtE,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,IAAI,EAAE,kBAAW;IACjB,OAAO,EAAE;QACP,oCAAmB;QACnB,8CAAwB;QACxB,8BAAgB;QAChB,4CAAuB;QACvB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,kBAAW;YACjB,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB;YACvC,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,MAAM,EAAE,qCAAqC;oBAC7C,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;iBACjF,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const createAccountAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
code: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
firstName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
-
company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
-
}>;
|
|
8
|
-
//# sourceMappingURL=create-account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-account.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-account.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB;;;;;;EAkD9B,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAccountAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
exports.createAccountAction = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.recurlyAuth,
|
|
10
|
-
name: 'create_account',
|
|
11
|
-
displayName: 'Create Account',
|
|
12
|
-
description: 'Create a billing account in Recurly.',
|
|
13
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: {
|
|
15
|
-
description: 'Creates a new billing account in Recurly to represent a customer, identified by a unique account code you supply. Use before creating subscriptions, since a subscription must be attached to an existing account. Not idempotent: each call attempts to create a new account, and reusing an account code that already exists will fail.',
|
|
16
|
-
idempotent: false,
|
|
17
|
-
},
|
|
18
|
-
props: {
|
|
19
|
-
code: pieces_framework_1.Property.ShortText({
|
|
20
|
-
displayName: 'Account Code',
|
|
21
|
-
description: 'A unique account code for this customer, for example acme-123.',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
email: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Email',
|
|
26
|
-
description: 'The primary email address for the billing account.',
|
|
27
|
-
required: true,
|
|
28
|
-
}),
|
|
29
|
-
firstName: pieces_framework_1.Property.ShortText({
|
|
30
|
-
displayName: 'First Name',
|
|
31
|
-
description: 'The customer’s first name.',
|
|
32
|
-
required: false,
|
|
33
|
-
}),
|
|
34
|
-
lastName: pieces_framework_1.Property.ShortText({
|
|
35
|
-
displayName: 'Last Name',
|
|
36
|
-
description: 'The customer’s last name.',
|
|
37
|
-
required: false,
|
|
38
|
-
}),
|
|
39
|
-
company: pieces_framework_1.Property.ShortText({
|
|
40
|
-
displayName: 'Company',
|
|
41
|
-
description: 'The company name for this billing account.',
|
|
42
|
-
required: false,
|
|
43
|
-
}),
|
|
44
|
-
},
|
|
45
|
-
run(context) {
|
|
46
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
var _a, _b, _c;
|
|
48
|
-
const requestBody = {
|
|
49
|
-
code: context.propsValue.code,
|
|
50
|
-
email: context.propsValue.email,
|
|
51
|
-
firstName: (_a = context.propsValue.firstName) !== null && _a !== void 0 ? _a : null,
|
|
52
|
-
lastName: (_b = context.propsValue.lastName) !== null && _b !== void 0 ? _b : null,
|
|
53
|
-
company: (_c = context.propsValue.company) !== null && _c !== void 0 ? _c : null,
|
|
54
|
-
};
|
|
55
|
-
const account = yield (0, client_1.createRecurlyClient)(context.auth).createAccount(requestBody);
|
|
56
|
-
return (0, client_1.flattenRecurlyResource)(account);
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
//# sourceMappingURL=create-account.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-account.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-account.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,kCAAsC;AACtC,6CAG0B;AAEb,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,sCAAsC;IACnD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,2UAA2U;QAC7U,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAA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CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const createSubscriptionAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
accountCode: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
planCode: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
currency: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
-
quantity: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=create-subscription.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-subscription.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-subscription.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,wBAAwB;;;;;EA8CnC,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSubscriptionAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
exports.createSubscriptionAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.recurlyAuth,
|
|
11
|
-
name: 'create_subscription',
|
|
12
|
-
displayName: 'Create Subscription',
|
|
13
|
-
description: 'Start a new subscription for an existing Recurly account.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Starts a new recurring subscription on a given plan for an existing Recurly account, billing in the specified currency. Use to begin charging a customer; the account and plan must already exist (referenced by their codes). Not idempotent: each call creates and begins billing a separate subscription.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
accountCode: (0, props_1.accountCodeDropdown)(true, 'Select the account that should own the subscription.'),
|
|
21
|
-
planCode: (0, props_1.planCodeDropdown)(true, 'Select the plan for the new subscription.'),
|
|
22
|
-
currency: pieces_framework_1.Property.ShortText({
|
|
23
|
-
displayName: 'Currency',
|
|
24
|
-
description: 'The 3-letter ISO currency code to bill in, for example USD.',
|
|
25
|
-
required: true,
|
|
26
|
-
defaultValue: 'USD',
|
|
27
|
-
}),
|
|
28
|
-
quantity: pieces_framework_1.Property.Number({
|
|
29
|
-
displayName: 'Quantity',
|
|
30
|
-
description: 'The subscription quantity. Leave at 1 for standard subscriptions.',
|
|
31
|
-
required: false,
|
|
32
|
-
defaultValue: 1,
|
|
33
|
-
}),
|
|
34
|
-
},
|
|
35
|
-
run(context) {
|
|
36
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
var _a;
|
|
38
|
-
const requestBody = {
|
|
39
|
-
planCode: context.propsValue.planCode,
|
|
40
|
-
currency: context.propsValue.currency,
|
|
41
|
-
account: {
|
|
42
|
-
code: context.propsValue.accountCode,
|
|
43
|
-
},
|
|
44
|
-
quantity: (_a = context.propsValue.quantity) !== null && _a !== void 0 ? _a : 1,
|
|
45
|
-
};
|
|
46
|
-
const subscription = yield (0, client_1.createRecurlyClient)(context.auth).createSubscription(requestBody);
|
|
47
|
-
return (0, client_1.flattenRecurlyResource)(subscription);
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=create-subscription.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-subscription.js","sourceRoot":"","sources":["../../../../src/lib/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AC7F,OAAO,IAAA,+BAAsB,EAAC,YAAY,CAAC,CAAC;QAC9C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const getAccountAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
accountCode: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=get-account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-account.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-account.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB;;EAwB3B,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAccountAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
exports.getAccountAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.recurlyAuth,
|
|
11
|
-
name: 'get_account',
|
|
12
|
-
displayName: 'Get Account',
|
|
13
|
-
description: 'Retrieve details for a billing account in Recurly.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Retrieves the full details of a single Recurly billing account by its account code. Use to look up a customer record or confirm an account exists before acting on it. Read-only and idempotent.',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
accountCode: (0, props_1.accountCodeDropdown)(true, 'Select the account you want to retrieve.'),
|
|
21
|
-
},
|
|
22
|
-
run(context) {
|
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const account = yield (0, client_1.createRecurlyClient)(context.auth).getAccount(`code-${context.propsValue.accountCode}`);
|
|
25
|
-
return (0, client_1.flattenRecurlyResource)(account);
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=get-account.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-account.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-account.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,kCAAsC;AACtC,6CAG0B;AAC1B,2CAAsD;AAEzC,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,oDAAoD;IACjE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,kMAAkM;QACpM,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,IAAA,2BAAmB,EAC9B,IAAI,EACJ,0CAA0C,CAC3C;KACF;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAmB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,CAChE,QAAQ,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CACzC,CAAC;YAEF,OAAO,IAAA,+BAAsB,EAAC,OAAO,CAAC,CAAC;QACzC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const listSubscriptionsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
accountCode: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
state: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
4
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=list-subscriptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-subscriptions.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-subscriptions.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,uBAAuB;;;;EA8ElC,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listSubscriptionsAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const client_1 = require("../common/client");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
exports.listSubscriptionsAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.recurlyAuth,
|
|
11
|
-
name: 'list_subscriptions',
|
|
12
|
-
displayName: 'List Subscriptions',
|
|
13
|
-
description: 'Browse subscriptions in Recurly, with an option to filter by account and state.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Lists subscriptions in Recurly, optionally scoped to a single account and/or filtered by state (active, canceled, expired, future, paused, or all when state is left empty). Use to find subscriptions or check what a customer is subscribed to; leaving the account code empty lists across all accounts. Read-only and idempotent.',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
accountCode: (0, props_1.accountCodeDropdown)(false, 'Optionally select an account to list only that account’s subscriptions.'),
|
|
21
|
-
state: pieces_framework_1.Property.StaticDropdown({
|
|
22
|
-
displayName: 'Subscription State',
|
|
23
|
-
description: 'Filter subscriptions by state.',
|
|
24
|
-
required: false,
|
|
25
|
-
defaultValue: 'active',
|
|
26
|
-
options: {
|
|
27
|
-
options: [
|
|
28
|
-
{
|
|
29
|
-
label: 'Active',
|
|
30
|
-
value: 'active',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
label: 'Canceled',
|
|
34
|
-
value: 'canceled',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
label: 'Expired',
|
|
38
|
-
value: 'expired',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
label: 'Future',
|
|
42
|
-
value: 'future',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
label: 'Paused',
|
|
46
|
-
value: 'paused',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
label: 'All',
|
|
50
|
-
value: '',
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
}),
|
|
55
|
-
limit: pieces_framework_1.Property.Number({
|
|
56
|
-
displayName: 'Limit',
|
|
57
|
-
description: 'The maximum number of subscriptions to return.',
|
|
58
|
-
required: false,
|
|
59
|
-
defaultValue: 50,
|
|
60
|
-
}),
|
|
61
|
-
},
|
|
62
|
-
run(context) {
|
|
63
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
var _a;
|
|
65
|
-
const limit = (_a = context.propsValue.limit) !== null && _a !== void 0 ? _a : 50;
|
|
66
|
-
const params = {
|
|
67
|
-
limit,
|
|
68
|
-
};
|
|
69
|
-
if (context.propsValue.state) {
|
|
70
|
-
params['state'] = context.propsValue.state;
|
|
71
|
-
}
|
|
72
|
-
const subscriptions = context.propsValue.accountCode
|
|
73
|
-
? yield (0, client_1.listAccountSubscriptions)(context.auth, context.propsValue.accountCode, params, limit)
|
|
74
|
-
: yield (0, client_1.listSubscriptions)(context.auth, params, limit);
|
|
75
|
-
return (0, client_1.flattenRecurlyResourceList)(subscriptions);
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
//# sourceMappingURL=list-subscriptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-subscriptions.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-subscriptions.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6CAI0B;AAC1B,kCAAsC;AACtC,2CAAsD;AAEzC,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,iFAAiF;IAC9F,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,uUAAuU;QACzU,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,IAAA,2BAAmB,EAC9B,KAAK,EACL,yEAAyE,CAC1E;QACD,KAAK,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC7B,WAAW,EAAE,oBAAoB;YACjC,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,QAAQ;YACtB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,QAAQ;wBACf,KAAK,EAAE,QAAQ;qBAChB;oBACD;wBACE,KAAK,EAAE,UAAU;wBACjB,KAAK,EAAE,UAAU;qBAClB;oBACD;wBACE,KAAK,EAAE,SAAS;wBAChB,KAAK,EAAE,SAAS;qBACjB;oBACD;wBACE,KAAK,EAAE,QAAQ;wBACf,KAAK,EAAE,QAAQ;qBAChB;oBACD;wBACE,KAAK,EAAE,QAAQ;wBACf,KAAK,EAAE,QAAQ;qBAChB;oBACD;wBACE,KAAK,EAAE,KAAK;wBACZ,KAAK,EAAE,EAAE;qBACV;iBACF;aACF;SACF,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,UAAU,CAAC,KAAK,mCAAI,EAAE,CAAC;YAC7C,MAAM,MAAM,GAAoC;gBAC9C,KAAK;aACN,CAAC;YAEF,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;gBAC7B,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;YAC7C,CAAC;YAED,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW;gBAClD,CAAC,CAAC,MAAM,IAAA,iCAAwB,EAC9B,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,UAAU,CAAC,WAAW,EAC9B,MAAM,EACN,KAAK,CACN;gBACD,CAAC,CAAC,MAAM,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;YAEzD,OAAO,IAAA,mCAA0B,EAAC,aAAa,CAAC,CAAC;QACnD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/auth.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const recurlyAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
-
export type RecurlyAuthType = AppConnectionValueForAuthProperty<typeof recurlyAuth>;
|
|
4
|
-
//# sourceMappingURL=auth.d.ts.map
|
package/src/lib/auth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAa,MAAM,gCAAgC,CAAC;AAI9F,eAAO,MAAM,WAAW,mEAoBtB,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,iCAAiC,CAAC,OAAO,WAAW,CAAC,CAAA"}
|
package/src/lib/auth.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.recurlyAuth = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
const recurly_1 = require("recurly");
|
|
8
|
-
exports.recurlyAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
9
|
-
displayName: 'API Key',
|
|
10
|
-
description: `You can obtain API key from [Developer Settings](https://app.recurly.com/go/developer/api_keys).`,
|
|
11
|
-
required: true,
|
|
12
|
-
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
13
|
-
const { error } = yield (0, shared_1.tryCatch)(() => new recurly_1.Client(auth).listSites().first());
|
|
14
|
-
if (error) {
|
|
15
|
-
return {
|
|
16
|
-
valid: false,
|
|
17
|
-
error: 'Invalid API key. Check the API key and try again.',
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
valid: true,
|
|
22
|
-
};
|
|
23
|
-
}),
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=auth.js.map
|
package/src/lib/auth.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA8F;AAC9F,iDAAgD;AAChD,qCAAiC;AAEpB,QAAA,WAAW,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC9C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,kGAAkG;IAC/G,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,iBAAQ,EAAC,GAAG,EAAE,CACpC,IAAI,gBAAM,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,CACrC,CAAC;QAEF,IAAI,KAAK,EAAE,CAAC;YACV,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,mDAAmD;aAC3D,CAAC;QACJ,CAAC;QAED,OAAO;YACL,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Account, Client, Plan, Subscription } from 'recurly';
|
|
2
|
-
import { RecurlyAuthType } from '../auth';
|
|
3
|
-
import { FlatRecord } from './utils';
|
|
4
|
-
export declare function createRecurlyClient(auth: RecurlyAuthType): Client;
|
|
5
|
-
export declare function listAccounts(auth: RecurlyAuthType): Promise<Account[]>;
|
|
6
|
-
export declare function listPlans(auth: RecurlyAuthType): Promise<Plan[]>;
|
|
7
|
-
export declare function listSubscriptions(auth: RecurlyAuthType, params: Record<string, string | number>, limit: number): Promise<Subscription[]>;
|
|
8
|
-
export declare function listAccountSubscriptions(auth: RecurlyAuthType, accountCode: string, params: Record<string, string | number>, limit: number): Promise<Subscription[]>;
|
|
9
|
-
export declare function flattenRecurlyResource(value: unknown): FlatRecord;
|
|
10
|
-
export declare function flattenRecurlyResourceList(values: unknown[]): FlatRecord[];
|
|
11
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,MAAM,EAEN,IAAI,EACJ,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAmC,MAAM,SAAS,CAAC;AAItE,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,eAAe,GACpB,MAAM,CAER;AAGD,wBAAsB,YAAY,CAChC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,OAAO,EAAE,CAAC,CASpB;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,IAAI,EAAE,CAAC,CASjB;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACvC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,YAAY,EAAE,CAAC,CAOzB;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,eAAe,EACrB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACvC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,YAAY,EAAE,CAAC,CAUzB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAEjE;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAE1E"}
|
package/src/lib/common/client.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createRecurlyClient = createRecurlyClient;
|
|
4
|
-
exports.listAccounts = listAccounts;
|
|
5
|
-
exports.listPlans = listPlans;
|
|
6
|
-
exports.listSubscriptions = listSubscriptions;
|
|
7
|
-
exports.listAccountSubscriptions = listAccountSubscriptions;
|
|
8
|
-
exports.flattenRecurlyResource = flattenRecurlyResource;
|
|
9
|
-
exports.flattenRecurlyResourceList = flattenRecurlyResourceList;
|
|
10
|
-
const tslib_1 = require("tslib");
|
|
11
|
-
const recurly_1 = require("recurly");
|
|
12
|
-
const utils_1 = require("./utils");
|
|
13
|
-
const MAX_DROPDOWN_ITEMS = 100;
|
|
14
|
-
function createRecurlyClient(auth) {
|
|
15
|
-
return new recurly_1.Client(auth.secret_text);
|
|
16
|
-
}
|
|
17
|
-
function listAccounts(auth) {
|
|
18
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
return yield collectPagerItems(createRecurlyClient(auth).listAccounts({
|
|
20
|
-
params: {
|
|
21
|
-
limit: MAX_DROPDOWN_ITEMS,
|
|
22
|
-
},
|
|
23
|
-
}), MAX_DROPDOWN_ITEMS);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function listPlans(auth) {
|
|
27
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
return yield collectPagerItems(createRecurlyClient(auth).listPlans({
|
|
29
|
-
params: {
|
|
30
|
-
limit: MAX_DROPDOWN_ITEMS,
|
|
31
|
-
},
|
|
32
|
-
}), MAX_DROPDOWN_ITEMS);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function listSubscriptions(auth, params, limit) {
|
|
36
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
return yield collectPagerItems(createRecurlyClient(auth).listSubscriptions({
|
|
38
|
-
params,
|
|
39
|
-
}), limit);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function listAccountSubscriptions(auth, accountCode, params, limit) {
|
|
43
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
return yield collectPagerItems(createRecurlyClient(auth).listAccountSubscriptions(`code-${accountCode}`, {
|
|
45
|
-
params,
|
|
46
|
-
}), limit);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function flattenRecurlyResource(value) {
|
|
50
|
-
return (0, utils_1.flattenRecord)(value);
|
|
51
|
-
}
|
|
52
|
-
function flattenRecurlyResourceList(values) {
|
|
53
|
-
return (0, utils_1.normalizeRecords)(values.map(utils_1.flattenRecord));
|
|
54
|
-
}
|
|
55
|
-
function collectPagerItems(pager, limit) {
|
|
56
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
var _a, e_1, _b, _c;
|
|
58
|
-
const items = [];
|
|
59
|
-
try {
|
|
60
|
-
for (var _d = true, _e = tslib_1.__asyncValues(pager.each()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
61
|
-
_c = _f.value;
|
|
62
|
-
_d = false;
|
|
63
|
-
const item = _c;
|
|
64
|
-
items.push(item);
|
|
65
|
-
if (items.length >= limit) {
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
71
|
-
finally {
|
|
72
|
-
try {
|
|
73
|
-
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
74
|
-
}
|
|
75
|
-
finally { if (e_1) throw e_1.error; }
|
|
76
|
-
}
|
|
77
|
-
return items;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":";;AAYA,kDAIC;AAGD,oCAWC;AAED,8BAWC;AAED,8CAWC;AAED,4DAeC;AAED,wDAEC;AAED,gEAEC;;AAjFD,qCAMiB;AAEjB,mCAAsE;AAEtE,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,SAAgB,mBAAmB,CACjC,IAAqB;IAErB,OAAO,IAAI,gBAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC;AAGD,SAAsB,YAAY,CAChC,IAAqB;;QAErB,OAAO,MAAM,iBAAiB,CAC5B,mBAAmB,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC;YACrC,MAAM,EAAE;gBAC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AI,CAAC,CAAC;gBAEjB,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;oBAC1B,MAAM;gBACR,CAAC;YACH,CAAC;;;;;;;;;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CAAA"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare function accountCodeDropdown(required: boolean, description: string): import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
2
|
-
export declare function planCodeDropdown(required: boolean, description: string): import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":"AAMA,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4RAgDzE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4RAgDtE"}
|
package/src/lib/common/props.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.accountCodeDropdown = accountCodeDropdown;
|
|
4
|
-
exports.planCodeDropdown = planCodeDropdown;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const shared_1 = require("@activepieces/shared");
|
|
8
|
-
const auth_1 = require("../auth");
|
|
9
|
-
const client_1 = require("./client");
|
|
10
|
-
function accountCodeDropdown(required, description) {
|
|
11
|
-
return pieces_framework_1.Property.Dropdown({
|
|
12
|
-
displayName: 'Account',
|
|
13
|
-
description,
|
|
14
|
-
required,
|
|
15
|
-
refreshers: [],
|
|
16
|
-
auth: auth_1.recurlyAuth,
|
|
17
|
-
options: (_a) => tslib_1.__awaiter(this, [_a], void 0, function* ({ auth, searchValue }) {
|
|
18
|
-
if (!auth) {
|
|
19
|
-
return {
|
|
20
|
-
disabled: true,
|
|
21
|
-
options: [],
|
|
22
|
-
placeholder: 'Connect your Recurly account first.',
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const { data: accounts, error } = yield (0, shared_1.tryCatch)(() => (0, client_1.listAccounts)(auth));
|
|
26
|
-
if (error) {
|
|
27
|
-
return {
|
|
28
|
-
disabled: true,
|
|
29
|
-
options: [],
|
|
30
|
-
placeholder: 'Failed to load accounts. Check your connection.',
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const filteredAccounts = filterAccounts(accounts, normalizeSearchValue(searchValue));
|
|
34
|
-
if (filteredAccounts.length === 0) {
|
|
35
|
-
return {
|
|
36
|
-
disabled: false,
|
|
37
|
-
options: [],
|
|
38
|
-
placeholder: 'No accounts found. Create one in Recurly first.',
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
disabled: false,
|
|
43
|
-
options: filteredAccounts.map((account) => {
|
|
44
|
-
var _a;
|
|
45
|
-
return ({
|
|
46
|
-
label: buildAccountLabel(account),
|
|
47
|
-
value: (_a = account.code) !== null && _a !== void 0 ? _a : '',
|
|
48
|
-
});
|
|
49
|
-
}).filter((option) => option.value.length > 0),
|
|
50
|
-
};
|
|
51
|
-
}),
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function planCodeDropdown(required, description) {
|
|
55
|
-
return pieces_framework_1.Property.Dropdown({
|
|
56
|
-
displayName: 'Plan',
|
|
57
|
-
description,
|
|
58
|
-
required,
|
|
59
|
-
refreshers: ['auth'],
|
|
60
|
-
auth: auth_1.recurlyAuth,
|
|
61
|
-
options: (_a) => tslib_1.__awaiter(this, [_a], void 0, function* ({ auth, searchValue }) {
|
|
62
|
-
if (!auth) {
|
|
63
|
-
return {
|
|
64
|
-
disabled: true,
|
|
65
|
-
options: [],
|
|
66
|
-
placeholder: 'Connect your Recurly account first.',
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
const { data: plans, error } = yield (0, shared_1.tryCatch)(() => (0, client_1.listPlans)(auth));
|
|
70
|
-
if (error) {
|
|
71
|
-
return {
|
|
72
|
-
disabled: true,
|
|
73
|
-
options: [],
|
|
74
|
-
placeholder: 'Failed to load plans. Check your connection.',
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
const filteredPlans = filterPlans(plans, normalizeSearchValue(searchValue));
|
|
78
|
-
if (filteredPlans.length === 0) {
|
|
79
|
-
return {
|
|
80
|
-
disabled: false,
|
|
81
|
-
options: [],
|
|
82
|
-
placeholder: 'No plans found. Create one in Recurly first.',
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
disabled: false,
|
|
87
|
-
options: filteredPlans.map((plan) => {
|
|
88
|
-
var _a;
|
|
89
|
-
return ({
|
|
90
|
-
label: buildPlanLabel(plan),
|
|
91
|
-
value: (_a = plan.code) !== null && _a !== void 0 ? _a : '',
|
|
92
|
-
});
|
|
93
|
-
}).filter((option) => option.value.length > 0),
|
|
94
|
-
};
|
|
95
|
-
}),
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
function normalizeSearchValue(searchValue) {
|
|
99
|
-
return typeof searchValue === 'string' ? searchValue : undefined;
|
|
100
|
-
}
|
|
101
|
-
function filterAccounts(accounts, searchValue) {
|
|
102
|
-
const normalizedSearchValue = searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim().toLowerCase();
|
|
103
|
-
if (!normalizedSearchValue) {
|
|
104
|
-
return accounts;
|
|
105
|
-
}
|
|
106
|
-
return accounts.filter((account) => buildAccountLabel(account).toLowerCase().includes(normalizedSearchValue));
|
|
107
|
-
}
|
|
108
|
-
function filterPlans(plans, searchValue) {
|
|
109
|
-
const normalizedSearchValue = searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim().toLowerCase();
|
|
110
|
-
if (!normalizedSearchValue) {
|
|
111
|
-
return plans;
|
|
112
|
-
}
|
|
113
|
-
return plans.filter((plan) => buildPlanLabel(plan).toLowerCase().includes(normalizedSearchValue));
|
|
114
|
-
}
|
|
115
|
-
function buildAccountLabel(account) {
|
|
116
|
-
var _a, _b;
|
|
117
|
-
const accountCode = (_a = account.code) !== null && _a !== void 0 ? _a : 'No code';
|
|
118
|
-
const accountEmail = (_b = account.email) !== null && _b !== void 0 ? _b : 'No email';
|
|
119
|
-
const accountName = [account.firstName, account.lastName]
|
|
120
|
-
.filter((value) => value)
|
|
121
|
-
.join(' ')
|
|
122
|
-
.trim();
|
|
123
|
-
if (accountName) {
|
|
124
|
-
return `${accountName} (${accountCode}, ${accountEmail})`;
|
|
125
|
-
}
|
|
126
|
-
return `${accountCode} (${accountEmail})`;
|
|
127
|
-
}
|
|
128
|
-
function buildPlanLabel(plan) {
|
|
129
|
-
var _a, _b;
|
|
130
|
-
return `${(_a = plan.name) !== null && _a !== void 0 ? _a : 'Unnamed plan'} (${(_b = plan.code) !== null && _b !== void 0 ? _b : 'No code'})`;
|
|
131
|
-
}
|
|
132
|
-
//# sourceMappingURL=props.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":";;AAMA,kDAgDC;AAED,4CAgDC;;AAxGD,qEAA0D;AAC1D,iDAAgD;AAEhD,kCAAsC;AACtC,qCAAmD;AAEnD,SAAgB,mBAAmB,CAAC,QAAiB,EAAE,WAAmB;IACxE,OAAO,2BAAQ,CAAC,QAAQ,CAAC;QACvB,WAAW,EAAE,SAAS;QACtB,WAAW;QACX,QAAQ;QACR,UAAU,EAAE,EAAE;QACd,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AAE,OAAO,CAAC,QAAQ,CAAC;SACtD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC;SACxB,IAAI,CAAC,GAAG,CAAC;SACT,IAAI,EAAE,CAAC;IAEV,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,GAAG,WAAW,KAAK,WAAW,KAAK,YAAY,GAAG,CAAC;IAC5D,CAAC;IAED,OAAO,GAAG,WAAW,KAAK,YAAY,GAAG,CAAC;AAC5C,CAAC;AAED,SAAS,cAAc,CAAC,IAAU;;IAChC,OAAO,GAAG,MAAA,IAAI,CAAC,IAAI,mCAAI,cAAc,KAAK,MAAA,IAAI,CAAC,IAAI,mCAAI,SAAS,GAAG,CAAC;AACtE,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function flattenRecord(value: unknown): FlatRecord;
|
|
2
|
-
export declare function normalizeRecords(records: FlatRecord[]): FlatRecord[];
|
|
3
|
-
type PrimitiveValue = string | number | boolean | null;
|
|
4
|
-
export type FlatRecord = Record<string, PrimitiveValue>;
|
|
5
|
-
export {};
|
|
6
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAIxD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAoBpE;AAkFD,KAAK,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC"}
|