@beabee/beabee-common 1.19.6 → 1.19.7
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/README.md +41 -0
- package/dist/cjs/data/index.cjs +87 -0
- package/dist/cjs/error/InvalidRule.cjs +35 -0
- package/dist/cjs/error/index.cjs +22 -0
- package/dist/cjs/index.cjs +28 -0
- package/dist/cjs/search/api-keys.cjs +35 -0
- package/dist/cjs/search/callouts.cjs +131 -0
- package/dist/cjs/search/contacts.cjs +105 -0
- package/dist/cjs/search/index.cjs +32 -0
- package/dist/cjs/search/notices.cjs +61 -0
- package/dist/cjs/search/operators.cjs +89 -0
- package/dist/cjs/search/payments.cjs +51 -0
- package/dist/cjs/types/api-key-filter-name.cjs +16 -0
- package/dist/cjs/types/array-filter-args.cjs +16 -0
- package/dist/cjs/types/base-callout-component-schema.cjs +16 -0
- package/dist/cjs/types/base-filter-args.cjs +16 -0
- package/dist/cjs/types/base-validated-rule.cjs +16 -0
- package/dist/cjs/types/callout-component-schema.cjs +16 -0
- package/dist/cjs/types/callout-filter-name.cjs +16 -0
- package/dist/cjs/types/callout-form-schema.cjs +16 -0
- package/dist/cjs/types/callout-navigation-schema.cjs +16 -0
- package/dist/cjs/types/callout-response-answer-address.cjs +16 -0
- package/dist/cjs/types/callout-response-answer-file-upload.cjs +16 -0
- package/dist/cjs/types/callout-response-answer.cjs +16 -0
- package/dist/cjs/types/callout-response-answers.cjs +16 -0
- package/dist/cjs/types/callout-response-comment-filter-name.cjs +16 -0
- package/dist/cjs/types/callout-response-filter-name.cjs +16 -0
- package/dist/cjs/types/callout-slide-schema.cjs +16 -0
- package/dist/cjs/types/callout-tag-filter-name.cjs +16 -0
- package/dist/cjs/types/content-callout-component-schema.cjs +16 -0
- package/dist/cjs/types/date-unit.cjs +16 -0
- package/dist/cjs/types/duration.cjs +16 -0
- package/dist/cjs/types/enum-filter-args.cjs +16 -0
- package/dist/cjs/types/feeable.cjs +16 -0
- package/dist/cjs/types/filter-args.cjs +16 -0
- package/dist/cjs/types/filter-type.cjs +16 -0
- package/dist/cjs/types/filters.cjs +16 -0
- package/dist/cjs/types/index.cjs +120 -0
- package/dist/cjs/types/input-callout-component-schema.cjs +16 -0
- package/dist/cjs/types/input-file-callout-component-schema.cjs +16 -0
- package/dist/cjs/types/nestable-callout-component-schema.cjs +16 -0
- package/dist/cjs/types/notice-filter-name.cjs +16 -0
- package/dist/cjs/types/operators-by-type.cjs +16 -0
- package/dist/cjs/types/other-filter-args.cjs +16 -0
- package/dist/cjs/types/paginated-query.cjs +16 -0
- package/dist/cjs/types/paginated.cjs +16 -0
- package/dist/cjs/types/payment-filter-name.cjs +16 -0
- package/dist/cjs/types/radio-callout-component-schema.cjs +16 -0
- package/dist/cjs/types/role-type.cjs +16 -0
- package/dist/cjs/types/rule-group.cjs +16 -0
- package/dist/cjs/types/rule-operator.cjs +16 -0
- package/dist/cjs/types/rule-opperator-params.cjs +16 -0
- package/dist/cjs/types/rule-value.cjs +16 -0
- package/dist/cjs/types/rule.cjs +16 -0
- package/dist/cjs/types/select-callout-component-schema.cjs +16 -0
- package/dist/cjs/types/stripe-fee-country.cjs +16 -0
- package/dist/cjs/types/unit-matches.cjs +16 -0
- package/dist/cjs/types/validated-boolean-rule.cjs +16 -0
- package/dist/cjs/types/validated-number-rule.cjs +16 -0
- package/dist/cjs/types/validated-rule-group.cjs +16 -0
- package/dist/cjs/types/validated-rule-value.cjs +16 -0
- package/dist/cjs/types/validated-rule.cjs +16 -0
- package/dist/cjs/types/validated-string-rule.cjs +16 -0
- package/dist/cjs/utils/callouts.cjs +137 -0
- package/dist/cjs/utils/date.cjs +87 -0
- package/dist/cjs/utils/index.cjs +28 -0
- package/dist/cjs/utils/payments.cjs +53 -0
- package/dist/cjs/utils/rules.cjs +109 -0
- package/dist/esm/data/index.js +57 -50
- package/dist/esm/error/InvalidRule.js +10 -7
- package/dist/esm/error/index.js +1 -2
- package/dist/esm/index.js +4 -7
- package/dist/esm/search/api-keys.js +10 -7
- package/dist/esm/search/callouts.js +100 -94
- package/dist/esm/search/contacts.js +83 -74
- package/dist/esm/search/index.js +6 -64
- package/dist/esm/search/notices.js +36 -33
- package/dist/esm/search/operators.js +62 -0
- package/dist/esm/search/payments.js +26 -23
- package/dist/esm/types/api-key-filter-name.js +0 -0
- package/dist/esm/types/array-filter-args.js +0 -0
- package/dist/esm/types/base-callout-component-schema.js +0 -0
- package/dist/esm/types/base-filter-args.js +0 -0
- package/dist/esm/types/base-validated-rule.js +0 -0
- package/dist/esm/types/callout-component-schema.js +0 -0
- package/dist/esm/types/callout-filter-name.js +0 -0
- package/dist/esm/types/callout-form-schema.js +0 -0
- package/dist/esm/types/callout-navigation-schema.js +0 -0
- package/dist/esm/types/callout-response-answer-address.js +0 -0
- package/dist/esm/types/callout-response-answer-file-upload.js +0 -0
- package/dist/esm/types/callout-response-answer.js +0 -0
- package/dist/esm/types/callout-response-answers.js +0 -0
- package/dist/esm/types/callout-response-comment-filter-name.js +0 -0
- package/dist/esm/types/callout-response-filter-name.js +0 -0
- package/dist/esm/types/callout-slide-schema.js +0 -0
- package/dist/esm/types/callout-tag-filter-name.js +0 -0
- package/dist/esm/types/content-callout-component-schema.js +0 -0
- package/dist/esm/types/date-unit.js +0 -0
- package/dist/esm/types/duration.js +0 -0
- package/dist/esm/types/enum-filter-args.js +0 -0
- package/dist/esm/types/feeable.js +0 -0
- package/dist/esm/types/filter-args.js +0 -0
- package/dist/esm/types/filter-type.js +0 -0
- package/dist/esm/types/filters.js +0 -0
- package/dist/esm/types/index.js +50 -0
- package/dist/esm/types/input-callout-component-schema.js +0 -0
- package/dist/esm/types/input-file-callout-component-schema.js +0 -0
- package/dist/esm/types/nestable-callout-component-schema.js +0 -0
- package/dist/esm/types/notice-filter-name.js +0 -0
- package/dist/esm/types/operators-by-type.js +0 -0
- package/dist/esm/types/other-filter-args.js +0 -0
- package/dist/esm/types/paginated-query.js +0 -0
- package/dist/esm/types/paginated.js +0 -0
- package/dist/esm/types/payment-filter-name.js +0 -0
- package/dist/esm/types/radio-callout-component-schema.js +0 -0
- package/dist/esm/types/role-type.js +0 -0
- package/dist/esm/types/rule-group.js +0 -0
- package/dist/esm/types/rule-operator.js +0 -0
- package/dist/esm/types/rule-opperator-params.js +0 -0
- package/dist/esm/types/rule-value.js +0 -0
- package/dist/esm/types/rule.js +0 -0
- package/dist/esm/types/select-callout-component-schema.js +0 -0
- package/dist/esm/types/stripe-fee-country.js +0 -0
- package/dist/esm/types/unit-matches.js +0 -0
- package/dist/esm/types/validated-boolean-rule.js +0 -0
- package/dist/esm/types/validated-number-rule.js +0 -0
- package/dist/esm/types/validated-rule-group.js +0 -0
- package/dist/esm/types/validated-rule-value.js +0 -0
- package/dist/esm/types/validated-rule.js +0 -0
- package/dist/esm/types/validated-string-rule.js +0 -0
- package/dist/esm/utils/callouts.js +91 -93
- package/dist/esm/utils/date.js +56 -56
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/payments.js +25 -23
- package/dist/esm/utils/rules.js +75 -58
- package/dist/types/data/index.d.ts +0 -4
- package/dist/types/error/InvalidRule.d.ts +2 -2
- package/dist/types/error/index.d.ts +1 -2
- package/dist/types/index.d.ts +5 -7
- package/dist/types/search/api-keys.d.ts +0 -1
- package/dist/types/search/callouts.d.ts +1 -5
- package/dist/types/search/contacts.d.ts +2 -1
- package/dist/types/search/index.d.ts +6 -194
- package/dist/types/search/notices.d.ts +1 -2
- package/dist/types/search/operators.d.ts +128 -0
- package/dist/types/search/payments.d.ts +1 -2
- package/dist/types/types/api-key-filter-name.d.ts +2 -0
- package/dist/types/types/array-filter-args.d.ts +5 -0
- package/dist/types/types/base-callout-component-schema.d.ts +9 -0
- package/dist/types/types/base-filter-args.d.ts +5 -0
- package/dist/types/types/base-validated-rule.d.ts +9 -0
- package/dist/types/types/callout-component-schema.d.ts +2 -0
- package/dist/types/types/callout-filter-name.d.ts +2 -0
- package/dist/types/types/callout-form-schema.d.ts +4 -0
- package/dist/types/types/callout-navigation-schema.d.ts +6 -0
- package/dist/types/types/callout-response-answer-address.d.ts +9 -0
- package/dist/types/types/callout-response-answer-file-upload.d.ts +3 -0
- package/dist/types/types/callout-response-answer.d.ts +2 -0
- package/dist/types/types/callout-response-answers.d.ts +5 -0
- package/dist/types/types/callout-response-comment-filter-name.d.ts +2 -0
- package/dist/types/types/callout-response-filter-name.d.ts +2 -0
- package/dist/types/types/callout-slide-schema.d.ts +7 -0
- package/dist/types/types/callout-tag-filter-name.d.ts +2 -0
- package/dist/types/types/content-callout-component-schema.d.ts +5 -0
- package/dist/types/types/date-unit.d.ts +2 -0
- package/dist/types/types/duration.d.ts +1 -0
- package/dist/types/types/enum-filter-args.d.ts +5 -0
- package/dist/types/types/feeable.d.ts +6 -0
- package/dist/types/types/filter-args.d.ts +2 -0
- package/dist/types/types/filter-type.d.ts +1 -0
- package/dist/types/types/filters.d.ts +2 -0
- package/dist/types/types/index.d.ts +50 -0
- package/dist/types/types/input-callout-component-schema.d.ts +6 -0
- package/dist/types/types/input-file-callout-component-schema.d.ts +5 -0
- package/dist/types/types/nestable-callout-component-schema.d.ts +6 -0
- package/dist/types/types/notice-filter-name.d.ts +2 -0
- package/dist/types/types/operators-by-type.d.ts +2 -0
- package/dist/types/types/other-filter-args.d.ts +4 -0
- package/dist/types/types/paginated-query.d.ts +8 -0
- package/dist/types/types/paginated.d.ts +6 -0
- package/dist/types/types/payment-filter-name.d.ts +2 -0
- package/dist/types/types/radio-callout-component-schema.d.ts +10 -0
- package/dist/types/types/role-type.d.ts +2 -0
- package/dist/types/types/rule-group.d.ts +5 -0
- package/dist/types/types/rule-operator.d.ts +2 -0
- package/dist/types/types/rule-opperator-params.d.ts +3 -0
- package/dist/types/types/rule-value.d.ts +1 -0
- package/dist/types/types/rule.d.ts +6 -0
- package/dist/types/types/select-callout-component-schema.d.ts +11 -0
- package/dist/types/types/stripe-fee-country.d.ts +1 -0
- package/dist/types/types/unit-matches.d.ts +2 -0
- package/dist/types/types/validated-boolean-rule.d.ts +2 -0
- package/dist/types/types/validated-number-rule.d.ts +2 -0
- package/dist/types/types/validated-rule-group.d.ts +5 -0
- package/dist/types/types/validated-rule-value.d.ts +2 -0
- package/dist/types/types/validated-rule.d.ts +2 -0
- package/dist/types/types/validated-string-rule.d.ts +2 -0
- package/dist/types/utils/callouts.d.ts +1 -3
- package/dist/types/utils/date.d.ts +3 -3
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/payments.d.ts +1 -7
- package/dist/types/utils/rules.d.ts +1 -1
- package/package.json +31 -12
- package/dist/cjs/data/callouts.js +0 -2
- package/dist/cjs/data/index.js +0 -67
- package/dist/cjs/error/InvalidRule.js +0 -11
- package/dist/cjs/error/index.js +0 -8
- package/dist/cjs/index.js +0 -23
- package/dist/cjs/search/api-keys.js +0 -11
- package/dist/cjs/search/callouts.js +0 -101
- package/dist/cjs/search/contacts.js +0 -78
- package/dist/cjs/search/index.js +0 -81
- package/dist/cjs/search/notices.js +0 -37
- package/dist/cjs/search/payments.js +0 -27
- package/dist/cjs/utils/callouts.js +0 -118
- package/dist/cjs/utils/date.js +0 -77
- package/dist/cjs/utils/payments.js +0 -31
- package/dist/cjs/utils/rules.js +0 -69
- package/dist/esm/data/callouts.js +0 -1
- package/dist/types/data/callouts.d.ts +0 -70
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type StripeFeeCountry = "eu" | "gb" | "ca";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { CalloutComponentSchema, CalloutFormSchema, CalloutResponseAnswer } from "../
|
|
2
|
-
import { FilterArgs } from "../search";
|
|
3
|
-
import { CalloutResponseAnswerAddress, CalloutResponseAnswerFileUpload } from "../data/callouts";
|
|
1
|
+
import type { CalloutComponentSchema, CalloutFormSchema, CalloutResponseAnswer, CalloutResponseAnswerAddress, CalloutResponseAnswerFileUpload, FilterArgs } from "../types/index.ts";
|
|
4
2
|
export declare function flattenComponents(components: CalloutComponentSchema[]): CalloutComponentSchema[];
|
|
5
3
|
export declare function filterComponents(components: CalloutComponentSchema[], filterFn: (component: CalloutComponentSchema) => boolean): CalloutComponentSchema[];
|
|
6
4
|
export declare function getCalloutComponents(formSchema: CalloutFormSchema): (CalloutComponentSchema & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { DateUnit, Duration } from "../types/index.ts";
|
|
2
|
+
export declare const dateUnits: readonly ["s", "m", "h", "d", "M", "y"];
|
|
3
|
+
export declare const dateUnitMap: Record<DateUnit, keyof Duration>;
|
|
3
4
|
export declare function parseDate(value: string, now?: Date): [Date, DateUnit];
|
|
4
5
|
export declare function getMinDateUnit(units: [DateUnit, ...DateUnit[]]): DateUnit;
|
|
5
6
|
export declare function getMinDateUnit(units: DateUnit[]): DateUnit | undefined;
|
|
6
7
|
export declare function isValidDate(s: string): boolean;
|
|
7
|
-
export {};
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface Feeable {
|
|
3
|
-
amount: number;
|
|
4
|
-
period: ContributionPeriod;
|
|
5
|
-
paymentMethod: PaymentMethod;
|
|
6
|
-
}
|
|
1
|
+
import type { Feeable, StripeFeeCountry } from "../types/index.ts";
|
|
7
2
|
export declare function calcPaymentFee(feeable: Feeable, country: StripeFeeCountry): number;
|
|
8
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Filters, Rule, RuleGroup, ValidatedRule, ValidatedRuleGroup } from "../
|
|
1
|
+
import type { Filters, Rule, RuleGroup, ValidatedRule, ValidatedRuleGroup } from "../types/index.ts";
|
|
2
2
|
export declare function isRuleGroup(ruleOrGroup: Rule | RuleGroup): ruleOrGroup is RuleGroup;
|
|
3
3
|
export declare function validateRule<Field extends string>(filters: Filters<Field>, rule: Rule): ValidatedRule<Field>;
|
|
4
4
|
export declare function validateRuleGroup<Field extends string>(filters: Filters<Field>, ruleGroup: RuleGroup): ValidatedRuleGroup<Field>;
|
package/package.json
CHANGED
|
@@ -1,16 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beabee/beabee-common",
|
|
3
|
-
"version": "1.19.
|
|
4
|
-
"description": "",
|
|
5
|
-
"
|
|
3
|
+
"version": "1.19.7",
|
|
4
|
+
"description": "Shared code between Beabee projects for Node.js, Deno and the browser",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/cjs/index.cjs",
|
|
6
7
|
"module": "./dist/esm/index.js",
|
|
7
8
|
"types": "./dist/types/index.d.ts",
|
|
8
9
|
"files": [
|
|
9
10
|
"dist/"
|
|
10
11
|
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.cjs",
|
|
16
|
+
"types": "./dist/types/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
11
20
|
"scripts": {
|
|
12
|
-
"test": "
|
|
13
|
-
"
|
|
21
|
+
"test": "npm run test:types && npm run test:node",
|
|
22
|
+
"test:deno": "deno task test",
|
|
23
|
+
"test:node": "npm run test:node:esm && npm run test:node:cjs",
|
|
24
|
+
"test:types": "tsc --noEmit --emitDeclarationOnly false",
|
|
25
|
+
"test:node:esm": "node test/node/import.mjs",
|
|
26
|
+
"test:node:cjs": "node test/node/require.cjs",
|
|
27
|
+
"clear": "rimraf ./dist/",
|
|
28
|
+
"build": "npm run clear && npm run generate:index && npm run sync:deps && npm run format && npm run build:types && npm run build:node",
|
|
29
|
+
"build:node": "npm run build:node:esm && npm run build:node:cjs",
|
|
30
|
+
"build:node:esm": "deno task build:node:esm",
|
|
31
|
+
"build:node:cjs": "deno task build:node:cjs",
|
|
32
|
+
"build:types": "tsc",
|
|
33
|
+
"generate:index": "deno task generate:index",
|
|
34
|
+
"sync:deps": "deno task sync:deps",
|
|
35
|
+
"format": "deno task format",
|
|
14
36
|
"prepublishOnly": "npm run build"
|
|
15
37
|
},
|
|
16
38
|
"repository": {
|
|
@@ -24,14 +46,11 @@
|
|
|
24
46
|
},
|
|
25
47
|
"homepage": "https://github.com/beabee-communityrm/beabee-common#readme",
|
|
26
48
|
"devDependencies": {
|
|
27
|
-
"@tsconfig/recommended": "^1.0.
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"rimraf": "^4.1.1",
|
|
31
|
-
"ts-jest": "^29.0.5",
|
|
32
|
-
"typescript": "^4.9.4"
|
|
49
|
+
"@tsconfig/recommended": "^1.0.3",
|
|
50
|
+
"rimraf": "^5.0.5",
|
|
51
|
+
"typescript": "^5.3.3"
|
|
33
52
|
},
|
|
34
53
|
"dependencies": {
|
|
35
|
-
"date-fns": "^2.
|
|
54
|
+
"date-fns": "^3.2.0"
|
|
36
55
|
}
|
|
37
56
|
}
|
package/dist/cjs/data/index.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.RoleTypes = exports.PaymentStatus = exports.PaymentMethod = exports.NewsletterStatus = exports.MembershipStatus = exports.ItemStatus = exports.ContributionType = exports.ContributionPeriod = void 0;
|
|
18
|
-
var ContributionPeriod;
|
|
19
|
-
(function (ContributionPeriod) {
|
|
20
|
-
ContributionPeriod["Monthly"] = "monthly";
|
|
21
|
-
ContributionPeriod["Annually"] = "annually";
|
|
22
|
-
})(ContributionPeriod = exports.ContributionPeriod || (exports.ContributionPeriod = {}));
|
|
23
|
-
var ContributionType;
|
|
24
|
-
(function (ContributionType) {
|
|
25
|
-
ContributionType["Automatic"] = "Automatic";
|
|
26
|
-
ContributionType["Manual"] = "Manual";
|
|
27
|
-
ContributionType["Gift"] = "Gift";
|
|
28
|
-
ContributionType["None"] = "None";
|
|
29
|
-
})(ContributionType = exports.ContributionType || (exports.ContributionType = {}));
|
|
30
|
-
var ItemStatus;
|
|
31
|
-
(function (ItemStatus) {
|
|
32
|
-
ItemStatus["Draft"] = "draft";
|
|
33
|
-
ItemStatus["Scheduled"] = "scheduled";
|
|
34
|
-
ItemStatus["Open"] = "open";
|
|
35
|
-
ItemStatus["Ended"] = "ended";
|
|
36
|
-
})(ItemStatus = exports.ItemStatus || (exports.ItemStatus = {}));
|
|
37
|
-
var MembershipStatus;
|
|
38
|
-
(function (MembershipStatus) {
|
|
39
|
-
MembershipStatus["Active"] = "active";
|
|
40
|
-
MembershipStatus["Expiring"] = "expiring";
|
|
41
|
-
MembershipStatus["Expired"] = "expired";
|
|
42
|
-
MembershipStatus["None"] = "none";
|
|
43
|
-
})(MembershipStatus = exports.MembershipStatus || (exports.MembershipStatus = {}));
|
|
44
|
-
var NewsletterStatus;
|
|
45
|
-
(function (NewsletterStatus) {
|
|
46
|
-
NewsletterStatus["Subscribed"] = "subscribed";
|
|
47
|
-
NewsletterStatus["Unsubscribed"] = "unsubscribed";
|
|
48
|
-
NewsletterStatus["Cleaned"] = "cleaned";
|
|
49
|
-
NewsletterStatus["Pending"] = "pending";
|
|
50
|
-
NewsletterStatus["None"] = "none";
|
|
51
|
-
})(NewsletterStatus = exports.NewsletterStatus || (exports.NewsletterStatus = {}));
|
|
52
|
-
var PaymentMethod;
|
|
53
|
-
(function (PaymentMethod) {
|
|
54
|
-
PaymentMethod["StripeCard"] = "s_card";
|
|
55
|
-
PaymentMethod["StripeSEPA"] = "s_sepa";
|
|
56
|
-
PaymentMethod["StripeBACS"] = "s_bacs";
|
|
57
|
-
PaymentMethod["GoCardlessDirectDebit"] = "gc_direct-debit";
|
|
58
|
-
})(PaymentMethod = exports.PaymentMethod || (exports.PaymentMethod = {}));
|
|
59
|
-
var PaymentStatus;
|
|
60
|
-
(function (PaymentStatus) {
|
|
61
|
-
PaymentStatus["Pending"] = "pending";
|
|
62
|
-
PaymentStatus["Successful"] = "successful";
|
|
63
|
-
PaymentStatus["Failed"] = "failed";
|
|
64
|
-
PaymentStatus["Cancelled"] = "cancelled";
|
|
65
|
-
})(PaymentStatus = exports.PaymentStatus || (exports.PaymentStatus = {}));
|
|
66
|
-
exports.RoleTypes = ["member", "admin", "superadmin"];
|
|
67
|
-
__exportStar(require("./callouts"), exports);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class InvalidRule extends Error {
|
|
4
|
-
constructor(rule, message) {
|
|
5
|
-
super();
|
|
6
|
-
this.rule = rule;
|
|
7
|
-
this.message = message;
|
|
8
|
-
Object.setPrototypeOf(this, InvalidRule.prototype);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.default = InvalidRule;
|
package/dist/cjs/error/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InvalidRule = void 0;
|
|
7
|
-
const InvalidRule_1 = __importDefault(require("./InvalidRule"));
|
|
8
|
-
exports.InvalidRule = InvalidRule_1.default;
|
package/dist/cjs/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./search"), exports);
|
|
18
|
-
__exportStar(require("./data"), exports);
|
|
19
|
-
__exportStar(require("./error"), exports);
|
|
20
|
-
__exportStar(require("./utils/callouts"), exports);
|
|
21
|
-
__exportStar(require("./utils/date"), exports);
|
|
22
|
-
__exportStar(require("./utils/payments"), exports);
|
|
23
|
-
__exportStar(require("./utils/rules"), exports);
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calloutTagFilters = exports.calloutResponseCommentFilters = exports.calloutResponseFilters = exports.calloutFilters = void 0;
|
|
4
|
-
const data_1 = require("../data");
|
|
5
|
-
exports.calloutFilters = {
|
|
6
|
-
slug: {
|
|
7
|
-
type: "text",
|
|
8
|
-
},
|
|
9
|
-
title: {
|
|
10
|
-
type: "text",
|
|
11
|
-
},
|
|
12
|
-
status: {
|
|
13
|
-
type: "enum",
|
|
14
|
-
options: [
|
|
15
|
-
data_1.ItemStatus.Draft,
|
|
16
|
-
data_1.ItemStatus.Scheduled,
|
|
17
|
-
data_1.ItemStatus.Open,
|
|
18
|
-
data_1.ItemStatus.Ended,
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
answeredBy: {
|
|
22
|
-
type: "contact",
|
|
23
|
-
},
|
|
24
|
-
starts: {
|
|
25
|
-
type: "date",
|
|
26
|
-
nullable: true,
|
|
27
|
-
},
|
|
28
|
-
expires: {
|
|
29
|
-
type: "date",
|
|
30
|
-
nullable: true,
|
|
31
|
-
},
|
|
32
|
-
hidden: {
|
|
33
|
-
type: "boolean",
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
exports.calloutResponseFilters = {
|
|
37
|
-
id: {
|
|
38
|
-
type: "text",
|
|
39
|
-
},
|
|
40
|
-
contact: {
|
|
41
|
-
type: "contact",
|
|
42
|
-
nullable: true,
|
|
43
|
-
},
|
|
44
|
-
callout: {
|
|
45
|
-
type: "text",
|
|
46
|
-
},
|
|
47
|
-
createdAt: {
|
|
48
|
-
type: "date",
|
|
49
|
-
},
|
|
50
|
-
updatedAt: {
|
|
51
|
-
type: "date",
|
|
52
|
-
},
|
|
53
|
-
bucket: {
|
|
54
|
-
type: "text",
|
|
55
|
-
nullable: true,
|
|
56
|
-
},
|
|
57
|
-
tags: {
|
|
58
|
-
type: "array",
|
|
59
|
-
},
|
|
60
|
-
assignee: {
|
|
61
|
-
type: "contact",
|
|
62
|
-
nullable: true,
|
|
63
|
-
},
|
|
64
|
-
answers: {
|
|
65
|
-
type: "blob",
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
exports.calloutResponseCommentFilters = {
|
|
69
|
-
id: {
|
|
70
|
-
type: "text",
|
|
71
|
-
},
|
|
72
|
-
responseId: {
|
|
73
|
-
type: "text",
|
|
74
|
-
},
|
|
75
|
-
contact: {
|
|
76
|
-
type: "contact",
|
|
77
|
-
},
|
|
78
|
-
createdAt: {
|
|
79
|
-
type: "date",
|
|
80
|
-
},
|
|
81
|
-
updatedAt: {
|
|
82
|
-
type: "date",
|
|
83
|
-
},
|
|
84
|
-
text: {
|
|
85
|
-
type: "text",
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
exports.calloutTagFilters = {
|
|
89
|
-
id: {
|
|
90
|
-
type: "text",
|
|
91
|
-
},
|
|
92
|
-
name: {
|
|
93
|
-
type: "text",
|
|
94
|
-
},
|
|
95
|
-
description: {
|
|
96
|
-
type: "text",
|
|
97
|
-
},
|
|
98
|
-
calloutSlug: {
|
|
99
|
-
type: "text",
|
|
100
|
-
},
|
|
101
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.contactFilters = void 0;
|
|
4
|
-
const data_1 = require("../data");
|
|
5
|
-
exports.contactFilters = {
|
|
6
|
-
id: {
|
|
7
|
-
type: "contact",
|
|
8
|
-
},
|
|
9
|
-
firstname: {
|
|
10
|
-
type: "text",
|
|
11
|
-
},
|
|
12
|
-
lastname: {
|
|
13
|
-
type: "text",
|
|
14
|
-
},
|
|
15
|
-
email: {
|
|
16
|
-
type: "text",
|
|
17
|
-
},
|
|
18
|
-
joined: {
|
|
19
|
-
type: "date",
|
|
20
|
-
},
|
|
21
|
-
lastSeen: {
|
|
22
|
-
type: "date",
|
|
23
|
-
},
|
|
24
|
-
contributionCancelled: {
|
|
25
|
-
type: "date",
|
|
26
|
-
nullable: true,
|
|
27
|
-
},
|
|
28
|
-
contributionType: {
|
|
29
|
-
type: "enum",
|
|
30
|
-
options: [
|
|
31
|
-
data_1.ContributionType.Automatic,
|
|
32
|
-
data_1.ContributionType.Gift,
|
|
33
|
-
data_1.ContributionType.Manual,
|
|
34
|
-
data_1.ContributionType.None,
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
contributionMonthlyAmount: {
|
|
38
|
-
type: "number",
|
|
39
|
-
},
|
|
40
|
-
contributionPeriod: {
|
|
41
|
-
type: "enum",
|
|
42
|
-
options: [data_1.ContributionPeriod.Monthly, data_1.ContributionPeriod.Annually],
|
|
43
|
-
},
|
|
44
|
-
deliveryOptIn: {
|
|
45
|
-
type: "boolean",
|
|
46
|
-
},
|
|
47
|
-
newsletterStatus: {
|
|
48
|
-
type: "enum",
|
|
49
|
-
options: [
|
|
50
|
-
data_1.NewsletterStatus.Subscribed,
|
|
51
|
-
data_1.NewsletterStatus.Unsubscribed,
|
|
52
|
-
data_1.NewsletterStatus.Cleaned,
|
|
53
|
-
data_1.NewsletterStatus.Pending,
|
|
54
|
-
data_1.NewsletterStatus.None,
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
activePermission: {
|
|
58
|
-
type: "enum",
|
|
59
|
-
options: data_1.RoleTypes,
|
|
60
|
-
},
|
|
61
|
-
activeMembership: {
|
|
62
|
-
type: "boolean",
|
|
63
|
-
},
|
|
64
|
-
membershipStarts: {
|
|
65
|
-
type: "date",
|
|
66
|
-
},
|
|
67
|
-
membershipExpires: {
|
|
68
|
-
type: "date",
|
|
69
|
-
},
|
|
70
|
-
manualPaymentSource: {
|
|
71
|
-
type: "text",
|
|
72
|
-
nullable: true,
|
|
73
|
-
},
|
|
74
|
-
tags: {
|
|
75
|
-
type: "array",
|
|
76
|
-
nullable: true,
|
|
77
|
-
},
|
|
78
|
-
};
|
package/dist/cjs/search/index.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *** Definitions for rules ***
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.operatorsByTypeMap = exports.operatorsByType = exports.nullableOperators = exports.ruleOperators = void 0;
|
|
19
|
-
exports.ruleOperators = [
|
|
20
|
-
"equal",
|
|
21
|
-
"not_equal",
|
|
22
|
-
"less",
|
|
23
|
-
"less_or_equal",
|
|
24
|
-
"greater",
|
|
25
|
-
"greater_or_equal",
|
|
26
|
-
"between",
|
|
27
|
-
"not_between",
|
|
28
|
-
"begins_with",
|
|
29
|
-
"not_begins_with",
|
|
30
|
-
"contains",
|
|
31
|
-
"not_contains",
|
|
32
|
-
"ends_with",
|
|
33
|
-
"not_ends_with",
|
|
34
|
-
"is_empty",
|
|
35
|
-
"is_not_empty",
|
|
36
|
-
];
|
|
37
|
-
const equalityOperators = {
|
|
38
|
-
equal: { args: 1 },
|
|
39
|
-
not_equal: { args: 1 },
|
|
40
|
-
};
|
|
41
|
-
const stringOperators = {
|
|
42
|
-
begins_with: { args: 1 },
|
|
43
|
-
ends_with: { args: 1 },
|
|
44
|
-
not_begins_with: { args: 1 },
|
|
45
|
-
not_ends_with: { args: 1 },
|
|
46
|
-
};
|
|
47
|
-
const numericOperators = {
|
|
48
|
-
...equalityOperators,
|
|
49
|
-
between: { args: 2 },
|
|
50
|
-
not_between: { args: 2 },
|
|
51
|
-
less: { args: 1 },
|
|
52
|
-
greater: { args: 1 },
|
|
53
|
-
less_or_equal: { args: 1 },
|
|
54
|
-
greater_or_equal: { args: 1 },
|
|
55
|
-
};
|
|
56
|
-
const arrayOperators = {
|
|
57
|
-
contains: { args: 1 },
|
|
58
|
-
not_contains: { args: 1 },
|
|
59
|
-
};
|
|
60
|
-
// Special operator can be applied across all fields if they are nullable
|
|
61
|
-
exports.nullableOperators = {
|
|
62
|
-
is_empty: { args: 0 },
|
|
63
|
-
is_not_empty: { args: 0 },
|
|
64
|
-
};
|
|
65
|
-
exports.operatorsByType = {
|
|
66
|
-
text: { ...equalityOperators, ...arrayOperators, ...stringOperators },
|
|
67
|
-
blob: arrayOperators,
|
|
68
|
-
date: numericOperators,
|
|
69
|
-
number: numericOperators,
|
|
70
|
-
boolean: { equal: equalityOperators.equal },
|
|
71
|
-
array: arrayOperators,
|
|
72
|
-
enum: equalityOperators,
|
|
73
|
-
contact: equalityOperators,
|
|
74
|
-
};
|
|
75
|
-
// More general type to allow mapping while maintaining full type above
|
|
76
|
-
exports.operatorsByTypeMap = exports.operatorsByType;
|
|
77
|
-
__exportStar(require("./api-keys"), exports);
|
|
78
|
-
__exportStar(require("./callouts"), exports);
|
|
79
|
-
__exportStar(require("./contacts"), exports);
|
|
80
|
-
__exportStar(require("./notices"), exports);
|
|
81
|
-
__exportStar(require("./payments"), exports);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.noticeFilters = void 0;
|
|
4
|
-
const data_1 = require("../data");
|
|
5
|
-
exports.noticeFilters = {
|
|
6
|
-
id: {
|
|
7
|
-
type: "text",
|
|
8
|
-
},
|
|
9
|
-
createdAt: {
|
|
10
|
-
type: "date",
|
|
11
|
-
},
|
|
12
|
-
updatedAt: {
|
|
13
|
-
type: "date",
|
|
14
|
-
},
|
|
15
|
-
name: {
|
|
16
|
-
type: "text",
|
|
17
|
-
},
|
|
18
|
-
expires: {
|
|
19
|
-
type: "date",
|
|
20
|
-
nullable: true,
|
|
21
|
-
},
|
|
22
|
-
enabled: {
|
|
23
|
-
type: "boolean",
|
|
24
|
-
},
|
|
25
|
-
text: {
|
|
26
|
-
type: "text",
|
|
27
|
-
},
|
|
28
|
-
status: {
|
|
29
|
-
type: "enum",
|
|
30
|
-
options: [
|
|
31
|
-
data_1.ItemStatus.Draft,
|
|
32
|
-
data_1.ItemStatus.Scheduled,
|
|
33
|
-
data_1.ItemStatus.Open,
|
|
34
|
-
data_1.ItemStatus.Ended,
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.paymentFilters = void 0;
|
|
4
|
-
const data_1 = require("../data");
|
|
5
|
-
exports.paymentFilters = {
|
|
6
|
-
id: {
|
|
7
|
-
type: "text",
|
|
8
|
-
},
|
|
9
|
-
contact: {
|
|
10
|
-
type: "contact",
|
|
11
|
-
},
|
|
12
|
-
chargeDate: {
|
|
13
|
-
type: "date",
|
|
14
|
-
},
|
|
15
|
-
amount: {
|
|
16
|
-
type: "number",
|
|
17
|
-
},
|
|
18
|
-
status: {
|
|
19
|
-
type: "enum",
|
|
20
|
-
options: [
|
|
21
|
-
data_1.PaymentStatus.Successful,
|
|
22
|
-
data_1.PaymentStatus.Pending,
|
|
23
|
-
data_1.PaymentStatus.Failed,
|
|
24
|
-
data_1.PaymentStatus.Cancelled,
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
};
|