@memberstack/dom 1.9.27 → 1.9.28
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/lib/index.d.mts +644 -0
- package/lib/index.d.ts +629 -34
- package/lib/index.js +14863 -6
- package/lib/index.mjs +14835 -0
- package/package.json +16 -10
- package/lib/auth/index.d.ts +0 -7
- package/lib/auth/index.js +0 -85
- package/lib/constants/endpoints.d.ts +0 -3
- package/lib/constants/endpoints.js +0 -6
- package/lib/methods/dom/index.d.ts +0 -0
- package/lib/methods/dom/index.js +0 -0
- package/lib/methods/dom/main-dom.d.ts +0 -12
- package/lib/methods/dom/main-dom.js +0 -12976
- package/lib/methods/dom/methods.d.ts +0 -10
- package/lib/methods/dom/methods.js +0 -159
- package/lib/methods/index.d.ts +0 -56
- package/lib/methods/index.js +0 -96
- package/lib/methods/requests/index.d.ts +0 -52
- package/lib/methods/requests/index.js +0 -706
- package/lib/methods/requests/requests.d.ts +0 -27
- package/lib/methods/requests/requests.js +0 -122
- package/lib/types/index.d.ts +0 -2
- package/lib/types/index.js +0 -18
- package/lib/types/params.d.ts +0 -161
- package/lib/types/params.js +0 -2
- package/lib/types/payloads.d.ts +0 -56
- package/lib/types/payloads.js +0 -2
- package/lib/types/utils/payloads.d.ts +0 -259
- package/lib/types/utils/payloads.js +0 -3
- package/lib/utils/cookies.d.ts +0 -5
- package/lib/utils/cookies.js +0 -66
- package/lib/utils/defaultMessageBox.d.ts +0 -3
- package/lib/utils/defaultMessageBox.js +0 -42
- package/lib/utils/fileInput.d.ts +0 -1
- package/lib/utils/fileInput.js +0 -16
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export declare enum HttpMethod {
|
|
2
|
-
POST = "POST",
|
|
3
|
-
GET = "GET"
|
|
4
|
-
}
|
|
5
|
-
export declare enum HttpHeaders {
|
|
6
|
-
AUTHORIZATION = "Authorization",
|
|
7
|
-
API_KEY = "X-API-Key",
|
|
8
|
-
APP_ID = "X-APP-ID",
|
|
9
|
-
API_VERSION = "X-API-Version",
|
|
10
|
-
USER_AGENT = "X-User-Agent"
|
|
11
|
-
}
|
|
12
|
-
export declare const createRequestHandler: ({ publicKey, appId, token, customEndpoint, }: {
|
|
13
|
-
publicKey: any;
|
|
14
|
-
appId: any;
|
|
15
|
-
token: any;
|
|
16
|
-
customEndpoint: any;
|
|
17
|
-
}) => {
|
|
18
|
-
sendRequest: (data: {
|
|
19
|
-
method: HttpMethod;
|
|
20
|
-
url: string;
|
|
21
|
-
data?: object;
|
|
22
|
-
headers?: object;
|
|
23
|
-
contentType?: string;
|
|
24
|
-
}, options?: {
|
|
25
|
-
token?: string;
|
|
26
|
-
}) => Promise<any>;
|
|
27
|
-
};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
-
};
|
|
52
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.createRequestHandler = exports.HttpHeaders = exports.HttpMethod = void 0;
|
|
54
|
-
var axios_1 = __importDefault(require("axios"));
|
|
55
|
-
var endpoints_1 = require("../../constants/endpoints");
|
|
56
|
-
var cookies_1 = require("../../utils/cookies");
|
|
57
|
-
var HttpMethod;
|
|
58
|
-
(function (HttpMethod) {
|
|
59
|
-
HttpMethod["POST"] = "POST";
|
|
60
|
-
HttpMethod["GET"] = "GET";
|
|
61
|
-
})(HttpMethod = exports.HttpMethod || (exports.HttpMethod = {}));
|
|
62
|
-
var HttpHeaders;
|
|
63
|
-
(function (HttpHeaders) {
|
|
64
|
-
HttpHeaders["AUTHORIZATION"] = "Authorization";
|
|
65
|
-
HttpHeaders["API_KEY"] = "X-API-Key";
|
|
66
|
-
HttpHeaders["APP_ID"] = "X-APP-ID";
|
|
67
|
-
HttpHeaders["API_VERSION"] = "X-API-Version";
|
|
68
|
-
HttpHeaders["USER_AGENT"] = "X-User-Agent";
|
|
69
|
-
})(HttpHeaders = exports.HttpHeaders || (exports.HttpHeaders = {}));
|
|
70
|
-
var createRequestHandler = function (_a) {
|
|
71
|
-
var publicKey = _a.publicKey, appId = _a.appId, token = _a.token, customEndpoint = _a.customEndpoint;
|
|
72
|
-
return {
|
|
73
|
-
sendRequest: function (data, options) { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
-
var url, memberToken, authHeader, formattedUrl, res, e_1;
|
|
75
|
-
var _a, _b, _c;
|
|
76
|
-
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
77
|
-
return __generator(this, function (_m) {
|
|
78
|
-
switch (_m.label) {
|
|
79
|
-
case 0:
|
|
80
|
-
_m.trys.push([0, 2, , 3]);
|
|
81
|
-
url = data.url;
|
|
82
|
-
memberToken = (0, cookies_1.getMemberToken)();
|
|
83
|
-
authHeader = [
|
|
84
|
-
(_e = (_d = data.headers) === null || _d === void 0 ? void 0 : _d["Authorization"]) === null || _e === void 0 ? void 0 : _e.replace("Bearer ", ""),
|
|
85
|
-
memberToken,
|
|
86
|
-
options === null || options === void 0 ? void 0 : options.token,
|
|
87
|
-
].find(function (x) { return x; });
|
|
88
|
-
formattedUrl = "".concat(customEndpoint || endpoints_1.endpoints.API).concat(url);
|
|
89
|
-
return [4 /*yield*/, (0, axios_1.default)({
|
|
90
|
-
method: data.method,
|
|
91
|
-
data: data.data,
|
|
92
|
-
url: formattedUrl,
|
|
93
|
-
headers: __assign(__assign(__assign(__assign(__assign({}, (authHeader && { authorization: "Bearer ".concat(authHeader) })), (publicKey && (_a = {}, _a[HttpHeaders.API_KEY] = publicKey, _a))), (appId && (_b = {}, _b[HttpHeaders.APP_ID] = appId, _b))), (_c = {}, _c[HttpHeaders.USER_AGENT] = "@memberstack/client@1.2.0", _c)), (data.contentType && { "Content-Type": data.contentType })),
|
|
94
|
-
withCredentials: true,
|
|
95
|
-
})];
|
|
96
|
-
case 1:
|
|
97
|
-
res = _m.sent();
|
|
98
|
-
if ((_f = res === null || res === void 0 ? void 0 : res.headers) === null || _f === void 0 ? void 0 : _f["ms-mid"]) {
|
|
99
|
-
token = res.headers["ms-mid"];
|
|
100
|
-
}
|
|
101
|
-
if ((_g = res === null || res === void 0 ? void 0 : res.data) === null || _g === void 0 ? void 0 : _g.error) {
|
|
102
|
-
if (res.data.error.name === "JsonWebTokenError") {
|
|
103
|
-
throw {
|
|
104
|
-
code: "client/invalid-token",
|
|
105
|
-
message: "An invalid token has been provided. Please make sure the token is valid.",
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
throw (_h = res.data) === null || _h === void 0 ? void 0 : _h.error;
|
|
109
|
-
}
|
|
110
|
-
return [2 /*return*/, res === null || res === void 0 ? void 0 : res.data];
|
|
111
|
-
case 2:
|
|
112
|
-
e_1 = _m.sent();
|
|
113
|
-
if (!e_1.response)
|
|
114
|
-
throw e_1;
|
|
115
|
-
throw ((_k = (_j = e_1.response) === null || _j === void 0 ? void 0 : _j.data) === null || _k === void 0 ? void 0 : _k.error) || ((_l = e_1.response) === null || _l === void 0 ? void 0 : _l.data);
|
|
116
|
-
case 3: return [2 /*return*/];
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}); },
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
exports.createRequestHandler = createRequestHandler;
|
package/lib/types/index.d.ts
DELETED
package/lib/types/index.js
DELETED
|
@@ -1,18 +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("./params"), exports);
|
|
18
|
-
__exportStar(require("./payloads"), exports);
|
package/lib/types/params.d.ts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
export declare type SignupMemberEmailPasswordParams = {
|
|
2
|
-
email: string;
|
|
3
|
-
password: string;
|
|
4
|
-
customFields?: Record<string, any>;
|
|
5
|
-
metaData?: Record<string, any>;
|
|
6
|
-
plans?: {
|
|
7
|
-
planId: string;
|
|
8
|
-
}[];
|
|
9
|
-
captchaToken?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare type UpdateMemberProfileImageParams = {
|
|
12
|
-
profileImage: File;
|
|
13
|
-
};
|
|
14
|
-
export declare type GetSecureContentParams = {
|
|
15
|
-
contentId: string;
|
|
16
|
-
};
|
|
17
|
-
export declare type SetPasswordParams = {
|
|
18
|
-
password: string;
|
|
19
|
-
};
|
|
20
|
-
export declare type SignupWithProviderParams = {
|
|
21
|
-
provider: string;
|
|
22
|
-
customFields?: Record<string, any>;
|
|
23
|
-
plans?: {
|
|
24
|
-
planId: string;
|
|
25
|
-
}[];
|
|
26
|
-
};
|
|
27
|
-
export declare type LoginWithProviderParams = {
|
|
28
|
-
provider: string;
|
|
29
|
-
};
|
|
30
|
-
export declare type LoginMemberPasswordlessParams = {
|
|
31
|
-
passwordlessToken: string;
|
|
32
|
-
email: string;
|
|
33
|
-
};
|
|
34
|
-
export declare type SendMemberLoginPasswordlessEmailParams = {
|
|
35
|
-
email: string;
|
|
36
|
-
};
|
|
37
|
-
export declare type SignupMemberAuthProviderParams = {
|
|
38
|
-
code: string;
|
|
39
|
-
provider: "GOOGLE" | "FACEBOOK";
|
|
40
|
-
planId?: string;
|
|
41
|
-
customFields?: Record<string, any>;
|
|
42
|
-
metaData?: Record<string, any>;
|
|
43
|
-
plans?: {
|
|
44
|
-
planId: string;
|
|
45
|
-
}[];
|
|
46
|
-
payment?: {
|
|
47
|
-
stripe?: {
|
|
48
|
-
paymentMethodId: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
export declare type LoginMemberEmailPasswordParams = {
|
|
53
|
-
email: string;
|
|
54
|
-
password: string;
|
|
55
|
-
};
|
|
56
|
-
export declare type UpdateMemberParams = {
|
|
57
|
-
customFields?: Record<string, any>;
|
|
58
|
-
};
|
|
59
|
-
export declare type UpdateMemberAuthParams = {
|
|
60
|
-
email?: string;
|
|
61
|
-
oldPassword?: string;
|
|
62
|
-
newPassword?: string;
|
|
63
|
-
};
|
|
64
|
-
export declare type PurchasePlansParams = {
|
|
65
|
-
plans: {
|
|
66
|
-
planId: string;
|
|
67
|
-
priceId?: string;
|
|
68
|
-
}[];
|
|
69
|
-
payment: {
|
|
70
|
-
cardId?: string;
|
|
71
|
-
stripe?: {
|
|
72
|
-
paymentMethodId: string;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
export declare type AddPlanParams = {
|
|
77
|
-
planId: string;
|
|
78
|
-
};
|
|
79
|
-
export declare type PurchasePlansWithCheckoutParams = {
|
|
80
|
-
priceId: string;
|
|
81
|
-
cancelUrl?: string;
|
|
82
|
-
successUrl?: string;
|
|
83
|
-
autoRedirect?: boolean;
|
|
84
|
-
};
|
|
85
|
-
export declare type LaunchStripeCustomerPortalParams = {
|
|
86
|
-
priceIds?: string[];
|
|
87
|
-
configuration?: object;
|
|
88
|
-
returnUrl?: string;
|
|
89
|
-
autoRedirect?: boolean;
|
|
90
|
-
};
|
|
91
|
-
export declare type OpenStripeCustomerPortalParams = {
|
|
92
|
-
configuration?: object;
|
|
93
|
-
returnUrl?: string;
|
|
94
|
-
autoRedirect?: boolean;
|
|
95
|
-
};
|
|
96
|
-
export declare type RemovePlanParams = {
|
|
97
|
-
planId: string;
|
|
98
|
-
};
|
|
99
|
-
export declare type CancelPlanParams = {
|
|
100
|
-
planConnectionId: string;
|
|
101
|
-
};
|
|
102
|
-
export declare type AddMemberCardParams = {
|
|
103
|
-
stripePaymentMethodId: string;
|
|
104
|
-
default?: boolean;
|
|
105
|
-
};
|
|
106
|
-
export declare type UpdateDefaultCardParams = {
|
|
107
|
-
cardId: string;
|
|
108
|
-
};
|
|
109
|
-
export declare type UpdatePlanPaymentParams = {
|
|
110
|
-
planConnectionId: string;
|
|
111
|
-
cardId: string;
|
|
112
|
-
};
|
|
113
|
-
export declare type GetMemberReceiptsParams = {
|
|
114
|
-
first?: number;
|
|
115
|
-
after?: string;
|
|
116
|
-
order?: "ASC" | "DESC";
|
|
117
|
-
};
|
|
118
|
-
export declare type GetMemberInvoicesParams = {
|
|
119
|
-
first?: number;
|
|
120
|
-
after?: string;
|
|
121
|
-
order?: "ASC" | "DESC";
|
|
122
|
-
};
|
|
123
|
-
export declare type UpdateMemberJSONParams = {
|
|
124
|
-
json: object;
|
|
125
|
-
};
|
|
126
|
-
export declare type GetMemberPurchasesParams = {
|
|
127
|
-
expandPlan?: boolean;
|
|
128
|
-
expandPrice?: boolean;
|
|
129
|
-
expandCard?: boolean;
|
|
130
|
-
expandSubscription?: boolean;
|
|
131
|
-
};
|
|
132
|
-
export declare type GetPlanParams = {
|
|
133
|
-
planId: string;
|
|
134
|
-
};
|
|
135
|
-
export declare type GetPlansParams = {
|
|
136
|
-
status?: "ALL" | "ACTIVE" | "INACTIVE";
|
|
137
|
-
};
|
|
138
|
-
export declare type SendMemberResetPasswordEmailParams = {
|
|
139
|
-
email: string;
|
|
140
|
-
};
|
|
141
|
-
export declare type ResetMemberPasswordParams = {
|
|
142
|
-
token: string;
|
|
143
|
-
newPassword: string;
|
|
144
|
-
};
|
|
145
|
-
export declare type ReplacePlanParams = {
|
|
146
|
-
planConnectionId: string;
|
|
147
|
-
newPlanId?: string;
|
|
148
|
-
priceId?: string;
|
|
149
|
-
payment?: {
|
|
150
|
-
cardId?: string;
|
|
151
|
-
stripe?: {
|
|
152
|
-
paymentMethodId: string;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
export declare type GetAuthenticationClientSecretParams = {
|
|
157
|
-
planConnectionId: string;
|
|
158
|
-
};
|
|
159
|
-
export declare type GetTotalCheckoutAmountParams = {
|
|
160
|
-
priceIds: string[];
|
|
161
|
-
};
|
package/lib/types/params.js
DELETED
package/lib/types/payloads.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Payload } from "./utils/payloads";
|
|
2
|
-
export declare type AppPayload = Response<Payload.Transforms["App"]>;
|
|
3
|
-
export declare type GetAppAndMemberPayload = Response<Payload.Transforms["GetAppAndMember"]>;
|
|
4
|
-
export declare type AddMemberCardPayload = Response<Payload.Transforms["Member"]>;
|
|
5
|
-
export declare type CancelPlanPayload = Response<Payload.Transforms["Member"]>;
|
|
6
|
-
export declare type RemovePlanPayload = Response<Payload.Transforms["RemovePlan"]>;
|
|
7
|
-
export declare type GetCurrentMemberPayload = Response<Payload.Transforms["Member"]>;
|
|
8
|
-
export declare type GetMemberJSONPayload = Response<Payload.Transforms["MemberJSON"]>;
|
|
9
|
-
export declare type GetMemberCardsPayload = Response<Payload.Transforms["MemberCard"][]>;
|
|
10
|
-
export declare type ConnectProviderPayload = Response<Payload.Transforms["AuthProviders"]>;
|
|
11
|
-
export declare type GetMemberInvoicesPayload = PaginatedResponse<Payload.Transforms["MemberInvoice"]>;
|
|
12
|
-
export declare type GetMemberReceiptsPayload = PaginatedResponse<Payload.Transforms["MemberReceipt"]>;
|
|
13
|
-
export declare type UpdateMemberProfileImagePayload = Response<{
|
|
14
|
-
profileImage: string;
|
|
15
|
-
}>;
|
|
16
|
-
export declare type GetSecureContentPayload = Response<Payload.Transforms["SecureContent"]>;
|
|
17
|
-
export declare type SetPasswordPayload = Response<Payload.Transforms["Member"]>;
|
|
18
|
-
export declare type GetRestrictedUrlGroupsPayload = Response<Payload.Transforms["RestrictedUrlGroup"][]>;
|
|
19
|
-
export declare type GetPlansPayload = Response<Payload.Transforms["Plan"][]>;
|
|
20
|
-
export declare type GetPlanPayload = Response<Payload.Transforms["Plan"]>;
|
|
21
|
-
export declare type LoginMemberEmailPasswordPayload = Response<Payload.Transforms["MemberAuth"]>;
|
|
22
|
-
export declare type SendMemberLoginPasswordlessEmailPayload = Response<{
|
|
23
|
-
success: boolean;
|
|
24
|
-
}>;
|
|
25
|
-
export declare type LogoutMemberPayload = Response<{
|
|
26
|
-
redirect?: string;
|
|
27
|
-
}>;
|
|
28
|
-
export declare type PurchasePlansPayload = Response<Payload.Transforms["Purchase"]>;
|
|
29
|
-
export declare type AddPlanPayload = Response<Payload.Transforms["AddPlan"]>;
|
|
30
|
-
export declare type PurchasePlansWithCheckoutPayload = Response<Payload.Transforms["PurchaseWithCheckout"]>;
|
|
31
|
-
export declare type LaunchStripeCustomerPortalPayload = Response<Payload.Transforms["LaunchStripeCustomerPortal"]>;
|
|
32
|
-
export declare type OpenStripeCustomerPortalPayload = Response<Payload.Transforms["OpenStripeCustomerPortal"]>;
|
|
33
|
-
export declare type SignupMemberEmailPasswordPayload = Response<Payload.Transforms["MemberAuth"]>;
|
|
34
|
-
export declare type SignupMemberAuthProviderPayload = Response<Payload.Transforms["MemberAuth"]>;
|
|
35
|
-
export declare type UpdateDefaultCardPayload = Response<Payload.Transforms["Member"]>;
|
|
36
|
-
export declare type UpdateMemberAuthPayload = Response<Payload.Transforms["Member"]>;
|
|
37
|
-
export declare type UpdateMemberPayload = Response<Payload.Transforms["Member"]>;
|
|
38
|
-
export declare type UpdatePlanPaymentPayload = Response<Payload.Transforms["Member"]>;
|
|
39
|
-
export declare type RefreshMemberTokensPayload = Response<Payload.Transforms["MemberAuth"]["tokens"]>;
|
|
40
|
-
export declare type SendMemberResetPasswordEmailPayload = Response<string>;
|
|
41
|
-
export declare type ReplacePlanPayload = Response<Payload.Transforms["Purchase"]>;
|
|
42
|
-
export declare type GetAuthProvidersPayload = Response<Payload.Transforms["AuthProvider"][]>;
|
|
43
|
-
export declare type GetTotalCheckoutAmountPayload = Response<Payload.Transforms["TotalCheckoutAmount"]>;
|
|
44
|
-
export declare type GetAuthenticationClientSecretPayload = Response<Payload.Transforms["AuthenticationClientSecret"]>;
|
|
45
|
-
export declare type SendMemberVerificationEmailPayload = Response<Payload.Transforms["SendMemberVerificationEmail"]>;
|
|
46
|
-
export declare type ResetMemberPassworPayload = Response<Payload.Transforms["ResetMemberPassword"]>;
|
|
47
|
-
declare type PaginatedResponse<T> = {
|
|
48
|
-
hasNext: boolean;
|
|
49
|
-
endCursor: string | null;
|
|
50
|
-
totalCount: number;
|
|
51
|
-
data: T[];
|
|
52
|
-
};
|
|
53
|
-
declare type Response<T> = {
|
|
54
|
-
data: T;
|
|
55
|
-
};
|
|
56
|
-
export {};
|
package/lib/types/payloads.js
DELETED
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
export declare namespace Payload {
|
|
2
|
-
interface PaginatedResponse<T> {
|
|
3
|
-
hasNext: boolean;
|
|
4
|
-
endCursor: string | null;
|
|
5
|
-
totalCount: number;
|
|
6
|
-
data: T[];
|
|
7
|
-
}
|
|
8
|
-
interface Transforms {
|
|
9
|
-
Pagination: {
|
|
10
|
-
hasNext: boolean;
|
|
11
|
-
endCursor: string | null;
|
|
12
|
-
totalCount: number;
|
|
13
|
-
};
|
|
14
|
-
RemovePlan: {
|
|
15
|
-
member: Transforms["Member"];
|
|
16
|
-
};
|
|
17
|
-
SendMemberVerificationEmail: {
|
|
18
|
-
success: boolean;
|
|
19
|
-
};
|
|
20
|
-
ResetMemberPassword: {
|
|
21
|
-
success: boolean;
|
|
22
|
-
};
|
|
23
|
-
GetAppAndMember: {
|
|
24
|
-
app: Transforms["App"];
|
|
25
|
-
member: Transforms["Member"] | null;
|
|
26
|
-
};
|
|
27
|
-
SecureContent: {
|
|
28
|
-
content: string;
|
|
29
|
-
type: "HTML" | "CSS" | "LINK" | "JS" | "JSON" | "TEXT" | "IMAGE" | "FILE";
|
|
30
|
-
};
|
|
31
|
-
App: {
|
|
32
|
-
id: string;
|
|
33
|
-
name: string;
|
|
34
|
-
mode: "live" | "sandbox";
|
|
35
|
-
plans: Transforms["Plan"][];
|
|
36
|
-
contentGroups: Transforms["RestrictedUrlGroup"][];
|
|
37
|
-
emailVerificationEnabled: boolean;
|
|
38
|
-
requireEmailVerification: boolean;
|
|
39
|
-
customField: Transforms["CustomField"][];
|
|
40
|
-
branding: Transforms["Branding"];
|
|
41
|
-
authProviders: Transforms["AuthProvider"][];
|
|
42
|
-
};
|
|
43
|
-
Branding: {
|
|
44
|
-
logo: string;
|
|
45
|
-
colors: {
|
|
46
|
-
lightMode: {
|
|
47
|
-
primaryButton: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
RestrictedUrlGroup: {
|
|
52
|
-
id: string;
|
|
53
|
-
name: string;
|
|
54
|
-
key: string;
|
|
55
|
-
allowAllMembers: boolean;
|
|
56
|
-
activeMemberHasAccess?: boolean;
|
|
57
|
-
redirect: string;
|
|
58
|
-
urls: {
|
|
59
|
-
url: string;
|
|
60
|
-
filter: string;
|
|
61
|
-
}[];
|
|
62
|
-
plans: {
|
|
63
|
-
id: string;
|
|
64
|
-
}[];
|
|
65
|
-
};
|
|
66
|
-
MemberAuth: {
|
|
67
|
-
tokens: {
|
|
68
|
-
accessToken: string;
|
|
69
|
-
expires: number;
|
|
70
|
-
type: "bearer";
|
|
71
|
-
};
|
|
72
|
-
member: Transforms["Member"];
|
|
73
|
-
redirect: string;
|
|
74
|
-
contentGroups?: Transforms["RestrictedUrlGroup"][];
|
|
75
|
-
};
|
|
76
|
-
MemberJSON: {
|
|
77
|
-
json: object;
|
|
78
|
-
};
|
|
79
|
-
AuthProviders: {
|
|
80
|
-
providers: {
|
|
81
|
-
provider: string;
|
|
82
|
-
}[];
|
|
83
|
-
message?: string;
|
|
84
|
-
};
|
|
85
|
-
Member: {
|
|
86
|
-
id: string;
|
|
87
|
-
verified: boolean;
|
|
88
|
-
profileImage: string;
|
|
89
|
-
auth: {
|
|
90
|
-
email: string;
|
|
91
|
-
hasPassword: boolean;
|
|
92
|
-
providers: {
|
|
93
|
-
provider: string;
|
|
94
|
-
}[];
|
|
95
|
-
};
|
|
96
|
-
loginRedirect: string;
|
|
97
|
-
stripeCustomerId: string;
|
|
98
|
-
createdAt: string;
|
|
99
|
-
metaData: object;
|
|
100
|
-
customFields: object;
|
|
101
|
-
permissions: string[] | [];
|
|
102
|
-
planConnections: Transforms["MemberPlanConnection"][];
|
|
103
|
-
};
|
|
104
|
-
MemberReceipt: {
|
|
105
|
-
id: string;
|
|
106
|
-
amount: number;
|
|
107
|
-
url: string;
|
|
108
|
-
stripe?: {
|
|
109
|
-
url: string;
|
|
110
|
-
};
|
|
111
|
-
number: string;
|
|
112
|
-
purchase: string;
|
|
113
|
-
invoice: string;
|
|
114
|
-
createdAt: string;
|
|
115
|
-
currency: string;
|
|
116
|
-
};
|
|
117
|
-
MemberInvoices: PaginatedResponse<{
|
|
118
|
-
id: string;
|
|
119
|
-
status: string;
|
|
120
|
-
amount: number;
|
|
121
|
-
url: string;
|
|
122
|
-
description: string;
|
|
123
|
-
number: string;
|
|
124
|
-
purchase: string;
|
|
125
|
-
}>;
|
|
126
|
-
MemberReceipts: PaginatedResponse<{
|
|
127
|
-
id: string;
|
|
128
|
-
amount: string;
|
|
129
|
-
url: string;
|
|
130
|
-
number: string;
|
|
131
|
-
planConnection: string;
|
|
132
|
-
invoice: Transforms["MemberInvoice"];
|
|
133
|
-
}>;
|
|
134
|
-
MemberCard: {
|
|
135
|
-
id: string;
|
|
136
|
-
brand: string;
|
|
137
|
-
expMonth: string;
|
|
138
|
-
expYear: string;
|
|
139
|
-
last4: string;
|
|
140
|
-
default: boolean;
|
|
141
|
-
};
|
|
142
|
-
MemberInvoice: {
|
|
143
|
-
id: string;
|
|
144
|
-
status: string;
|
|
145
|
-
amount: number;
|
|
146
|
-
url: string;
|
|
147
|
-
description: string;
|
|
148
|
-
number: string;
|
|
149
|
-
planConnection: string;
|
|
150
|
-
createdAt: string;
|
|
151
|
-
currency: string;
|
|
152
|
-
};
|
|
153
|
-
Plan: {
|
|
154
|
-
id: string;
|
|
155
|
-
name: string;
|
|
156
|
-
description: string;
|
|
157
|
-
status: string;
|
|
158
|
-
redirects: {
|
|
159
|
-
afterLogin: string;
|
|
160
|
-
afterLogout: string;
|
|
161
|
-
afterSignup: string;
|
|
162
|
-
};
|
|
163
|
-
prices?: Transforms["Price"][] | [];
|
|
164
|
-
};
|
|
165
|
-
Price: {
|
|
166
|
-
id: string;
|
|
167
|
-
amount: string;
|
|
168
|
-
interval: {
|
|
169
|
-
type: string;
|
|
170
|
-
count: number;
|
|
171
|
-
};
|
|
172
|
-
name: string;
|
|
173
|
-
type: string;
|
|
174
|
-
status: string;
|
|
175
|
-
currency: string;
|
|
176
|
-
};
|
|
177
|
-
Permission: {
|
|
178
|
-
id: string;
|
|
179
|
-
name: string;
|
|
180
|
-
description: string;
|
|
181
|
-
};
|
|
182
|
-
PermissionGroup: {
|
|
183
|
-
id: string;
|
|
184
|
-
name: string;
|
|
185
|
-
permissions: Transforms["Permission"][];
|
|
186
|
-
};
|
|
187
|
-
CustomField: {
|
|
188
|
-
order: number;
|
|
189
|
-
key: string;
|
|
190
|
-
label: string;
|
|
191
|
-
hidden: boolean;
|
|
192
|
-
};
|
|
193
|
-
MemberPlanConnection: {
|
|
194
|
-
id: string;
|
|
195
|
-
active: boolean;
|
|
196
|
-
status: string;
|
|
197
|
-
planId: string;
|
|
198
|
-
type: string;
|
|
199
|
-
payment: {
|
|
200
|
-
amount: number;
|
|
201
|
-
currency: string;
|
|
202
|
-
status: string;
|
|
203
|
-
lastBillingDate: number | null;
|
|
204
|
-
nextBillingDate: number | null;
|
|
205
|
-
cancelAtDate: number | null;
|
|
206
|
-
lastInvoice: string | null;
|
|
207
|
-
lastReceipt: string | null;
|
|
208
|
-
card: string;
|
|
209
|
-
} | null;
|
|
210
|
-
};
|
|
211
|
-
Purchase: {
|
|
212
|
-
plan: string;
|
|
213
|
-
payment: {
|
|
214
|
-
requiresPayment: boolean;
|
|
215
|
-
requiresAuthentication: boolean;
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
AddPlan: {
|
|
219
|
-
redirect: string;
|
|
220
|
-
member: Transforms["Member"];
|
|
221
|
-
};
|
|
222
|
-
PurchaseWithCheckout: {
|
|
223
|
-
url: string;
|
|
224
|
-
};
|
|
225
|
-
LaunchStripeCustomerPortal: {
|
|
226
|
-
url: string;
|
|
227
|
-
};
|
|
228
|
-
OpenStripeCustomerPortal: {
|
|
229
|
-
url: string;
|
|
230
|
-
};
|
|
231
|
-
AuthenticationClientSecret: string;
|
|
232
|
-
AuthProvider: {
|
|
233
|
-
clientId: string;
|
|
234
|
-
provider: string;
|
|
235
|
-
providerType: string;
|
|
236
|
-
icon: string;
|
|
237
|
-
};
|
|
238
|
-
TotalCheckoutAmount: {
|
|
239
|
-
total: number;
|
|
240
|
-
subTotal: number;
|
|
241
|
-
currency: string;
|
|
242
|
-
setupFee?: {
|
|
243
|
-
enabled: boolean;
|
|
244
|
-
amount: number;
|
|
245
|
-
name: string;
|
|
246
|
-
};
|
|
247
|
-
freeTrial?: {
|
|
248
|
-
days: number;
|
|
249
|
-
enabled: boolean;
|
|
250
|
-
};
|
|
251
|
-
tax?: {
|
|
252
|
-
name: string;
|
|
253
|
-
percent: number;
|
|
254
|
-
description: string;
|
|
255
|
-
}[];
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
export {};
|
package/lib/utils/cookies.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const setUseCookies: () => void;
|
|
2
|
-
export declare const setMemberToken: (token: any, expires?: number) => void;
|
|
3
|
-
export declare const removeMemberToken: () => void;
|
|
4
|
-
export declare const getMemberToken: () => any;
|
|
5
|
-
export declare const setMemberTokenIfAvailable: () => void;
|