@memberstack/dom 1.9.44 → 2.0.0
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 +4 -0
- package/lib/constants/endpoints.js +1 -1
- package/lib/constants/endpoints.mjs +1 -1
- package/lib/index.d.mts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +62 -23
- package/lib/index.mjs +62 -23
- package/lib/methods/index.js +62 -23
- package/lib/methods/index.mjs +62 -23
- package/lib/methods/requests/index.js +62 -23
- package/lib/methods/requests/index.mjs +62 -23
- package/lib/methods/requests/requests.js +1 -1
- package/lib/methods/requests/requests.mjs +1 -1
- package/lib/types/index.d.mts +2 -2
- package/lib/types/index.d.ts +2 -2
- package/lib/types/params.d.mts +17 -4
- package/lib/types/params.d.ts +17 -4
- package/lib/types/payloads.d.mts +11 -3
- package/lib/types/payloads.d.ts +11 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ __export(endpoints_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(endpoints_exports);
|
|
25
25
|
var endpoints = {
|
|
26
|
-
API: "https://
|
|
26
|
+
API: "https://client.memberstack.com"
|
|
27
27
|
};
|
|
28
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
29
|
0 && (module.exports = {
|
package/lib/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GetCurrentMemberParams, MemberstackOptions } from './methods/requests/index.mjs';
|
|
2
2
|
import { GetPostsParams, GetThreadsParams, CreatePostParams, UpdatePostParams, PostVoteParams, DeletePostParams, CreateThreadParams, UpdateThreadParams, ThreadVoteParams, DeleteThreadParams, GetSecureContentParams, SignupWithProviderParams, LoginWithProviderParams, LoginMemberEmailPasswordParams, SendMemberLoginPasswordlessEmailParams, LoginMemberPasswordlessParams, GetPlanParams, UpdateMemberJSONParams, AddPlanParams, PurchasePlansWithCheckoutParams, LaunchStripeCustomerPortalParams, RemovePlanParams, UpdateMemberParams, UpdateMemberAuthParams, SetPasswordParams, SignupMemberEmailPasswordParams, JoinTeamParams, GetTeamParams, RemoveMemberFromTeamParams, GenerateInviteTokenParams, UpdateMemberProfileImageParams, SendMemberResetPasswordEmailParams, ResetMemberPasswordParams, GetDataTableParams, GetDataRecordsParams, CreateDataRecordParams, GetDataRecordParams, UpdateDataRecordParams, DeleteDataRecordParams, QueryDataRecordsParams } from './types/params.mjs';
|
|
3
|
-
export { AddMemberCardParams, CancelPlanParams, CountClause, DataRecordsQuery, GetAuthenticationClientSecretParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlansParams, GetTotalCheckoutAmountParams, IncludeClause, OpenStripeCustomerPortalParams, OrderByClause, PurchasePlansParams, ReplacePlanParams, SelectClause, SignupMemberAuthProviderParams, UpdateDefaultCardParams, UpdatePlanPaymentParams, WhereClause, WhereOperators } from './types/params.mjs';
|
|
3
|
+
export { AddMemberCardParams, CancelPlanParams, CountClause, DataRecordsQuery, GetAuthenticationClientSecretParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlansParams, GetTotalCheckoutAmountParams, IncludeClause, MemberReferenceOperation, MemberReferenceSelector, OpenStripeCustomerPortalParams, OrderByClause, PurchasePlansParams, ReferenceOperation, ReferenceSelector, ReplacePlanParams, SelectClause, SignupMemberAuthProviderParams, UpdateDefaultCardParams, UpdatePlanPaymentParams, WhereClause, WhereOperators } from './types/params.mjs';
|
|
4
4
|
import { DeleteMemberPayload, GetPostsPayload, GetThreadsPayload, CreatePostPayload, UpdatePostPayload, CreateThreadPayload, UpdateThreadPayload, GetSecureContentPayload, ConnectProviderPayload, GetAppAndMemberPayload, AppPayload, LoginMemberEmailPasswordPayload, SendMemberLoginPasswordlessEmailPayload, GetPlanPayload, GetPlansPayload, GetRestrictedUrlGroupsPayload, GetCurrentMemberPayload, GetMemberJSONPayload, AddPlanPayload, PurchasePlansWithCheckoutPayload, LaunchStripeCustomerPortalPayload, RemovePlanPayload, UpdateMemberPayload, UpdateMemberAuthPayload, SetPasswordPayload, SignupMemberEmailPasswordPayload, UpdateMemberProfileImagePayload, SendMemberVerificationEmailPayload, SendMemberResetPasswordEmailPayload, ResetMemberPassworPayload, LogoutMemberPayload, GetDataTablesPayload, GetDataTablePayload, GetDataRecordsPayload, CreateDataRecordPayload, GetDataRecordPayload, UpdateDataRecordPayload, DeleteDataRecordPayload, QueryDataRecordsPayload } from './types/payloads.mjs';
|
|
5
|
-
export { AddMemberCardPayload, CancelPlanPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberReceiptsPayload, GetTotalCheckoutAmountPayload, OpenStripeCustomerPortalPayload, PurchasePlansPayload, RefreshMemberTokensPayload, ReplacePlanPayload, SignupMemberAuthProviderPayload, UpdateDefaultCardPayload, UpdatePlanPaymentPayload } from './types/payloads.mjs';
|
|
5
|
+
export { AddMemberCardPayload, CancelPlanPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberReceiptsPayload, GetTotalCheckoutAmountPayload, MemberReferenceFieldResult, OpenStripeCustomerPortalPayload, PurchasePlansPayload, ReferenceFieldResult, RefreshMemberTokensPayload, ReplacePlanPayload, SignupMemberAuthProviderPayload, UpdateDefaultCardPayload, UpdatePlanPaymentPayload } from './types/payloads.mjs';
|
|
6
6
|
import { MemberstackTranslations } from './types/translations.mjs';
|
|
7
7
|
import { DOMConfig } from './methods/index.mjs';
|
|
8
8
|
import './types/utils/payloads.mjs';
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GetCurrentMemberParams, MemberstackOptions } from './methods/requests/index.js';
|
|
2
2
|
import { GetPostsParams, GetThreadsParams, CreatePostParams, UpdatePostParams, PostVoteParams, DeletePostParams, CreateThreadParams, UpdateThreadParams, ThreadVoteParams, DeleteThreadParams, GetSecureContentParams, SignupWithProviderParams, LoginWithProviderParams, LoginMemberEmailPasswordParams, SendMemberLoginPasswordlessEmailParams, LoginMemberPasswordlessParams, GetPlanParams, UpdateMemberJSONParams, AddPlanParams, PurchasePlansWithCheckoutParams, LaunchStripeCustomerPortalParams, RemovePlanParams, UpdateMemberParams, UpdateMemberAuthParams, SetPasswordParams, SignupMemberEmailPasswordParams, JoinTeamParams, GetTeamParams, RemoveMemberFromTeamParams, GenerateInviteTokenParams, UpdateMemberProfileImageParams, SendMemberResetPasswordEmailParams, ResetMemberPasswordParams, GetDataTableParams, GetDataRecordsParams, CreateDataRecordParams, GetDataRecordParams, UpdateDataRecordParams, DeleteDataRecordParams, QueryDataRecordsParams } from './types/params.js';
|
|
3
|
-
export { AddMemberCardParams, CancelPlanParams, CountClause, DataRecordsQuery, GetAuthenticationClientSecretParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlansParams, GetTotalCheckoutAmountParams, IncludeClause, OpenStripeCustomerPortalParams, OrderByClause, PurchasePlansParams, ReplacePlanParams, SelectClause, SignupMemberAuthProviderParams, UpdateDefaultCardParams, UpdatePlanPaymentParams, WhereClause, WhereOperators } from './types/params.js';
|
|
3
|
+
export { AddMemberCardParams, CancelPlanParams, CountClause, DataRecordsQuery, GetAuthenticationClientSecretParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlansParams, GetTotalCheckoutAmountParams, IncludeClause, MemberReferenceOperation, MemberReferenceSelector, OpenStripeCustomerPortalParams, OrderByClause, PurchasePlansParams, ReferenceOperation, ReferenceSelector, ReplacePlanParams, SelectClause, SignupMemberAuthProviderParams, UpdateDefaultCardParams, UpdatePlanPaymentParams, WhereClause, WhereOperators } from './types/params.js';
|
|
4
4
|
import { DeleteMemberPayload, GetPostsPayload, GetThreadsPayload, CreatePostPayload, UpdatePostPayload, CreateThreadPayload, UpdateThreadPayload, GetSecureContentPayload, ConnectProviderPayload, GetAppAndMemberPayload, AppPayload, LoginMemberEmailPasswordPayload, SendMemberLoginPasswordlessEmailPayload, GetPlanPayload, GetPlansPayload, GetRestrictedUrlGroupsPayload, GetCurrentMemberPayload, GetMemberJSONPayload, AddPlanPayload, PurchasePlansWithCheckoutPayload, LaunchStripeCustomerPortalPayload, RemovePlanPayload, UpdateMemberPayload, UpdateMemberAuthPayload, SetPasswordPayload, SignupMemberEmailPasswordPayload, UpdateMemberProfileImagePayload, SendMemberVerificationEmailPayload, SendMemberResetPasswordEmailPayload, ResetMemberPassworPayload, LogoutMemberPayload, GetDataTablesPayload, GetDataTablePayload, GetDataRecordsPayload, CreateDataRecordPayload, GetDataRecordPayload, UpdateDataRecordPayload, DeleteDataRecordPayload, QueryDataRecordsPayload } from './types/payloads.js';
|
|
5
|
-
export { AddMemberCardPayload, CancelPlanPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberReceiptsPayload, GetTotalCheckoutAmountPayload, OpenStripeCustomerPortalPayload, PurchasePlansPayload, RefreshMemberTokensPayload, ReplacePlanPayload, SignupMemberAuthProviderPayload, UpdateDefaultCardPayload, UpdatePlanPaymentPayload } from './types/payloads.js';
|
|
5
|
+
export { AddMemberCardPayload, CancelPlanPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberReceiptsPayload, GetTotalCheckoutAmountPayload, MemberReferenceFieldResult, OpenStripeCustomerPortalPayload, PurchasePlansPayload, ReferenceFieldResult, RefreshMemberTokensPayload, ReplacePlanPayload, SignupMemberAuthProviderPayload, UpdateDefaultCardPayload, UpdatePlanPaymentPayload } from './types/payloads.js';
|
|
6
6
|
import { MemberstackTranslations } from './types/translations.js';
|
|
7
7
|
import { DOMConfig } from './methods/index.js';
|
|
8
8
|
import './types/utils/payloads.js';
|
package/lib/index.js
CHANGED
|
@@ -30934,7 +30934,7 @@ var import_axios = __toESM(require("axios"));
|
|
|
30934
30934
|
|
|
30935
30935
|
// src/constants/endpoints.ts
|
|
30936
30936
|
var endpoints = {
|
|
30937
|
-
API: "https://
|
|
30937
|
+
API: "https://client.memberstack.com"
|
|
30938
30938
|
};
|
|
30939
30939
|
|
|
30940
30940
|
// src/methods/requests/requests.ts
|
|
@@ -31957,7 +31957,7 @@ var initRequest = ({
|
|
|
31957
31957
|
return __async(this, null, function* () {
|
|
31958
31958
|
return sendRequest({
|
|
31959
31959
|
method: "GET" /* GET */,
|
|
31960
|
-
url: `/data-tables`,
|
|
31960
|
+
url: `/v1/data-tables`,
|
|
31961
31961
|
headers: addHeaders(options)
|
|
31962
31962
|
});
|
|
31963
31963
|
});
|
|
@@ -31966,35 +31966,59 @@ var initRequest = ({
|
|
|
31966
31966
|
return __async(this, null, function* () {
|
|
31967
31967
|
return sendRequest({
|
|
31968
31968
|
method: "GET" /* GET */,
|
|
31969
|
-
url: `/data-tables/${params.tableKey}`,
|
|
31969
|
+
url: `/v1/data-tables/${params.tableKey}`,
|
|
31970
31970
|
headers: addHeaders(options)
|
|
31971
31971
|
});
|
|
31972
31972
|
});
|
|
31973
31973
|
},
|
|
31974
31974
|
getDataRecords(params, options) {
|
|
31975
31975
|
return __async(this, null, function* () {
|
|
31976
|
-
|
|
31977
|
-
|
|
31978
|
-
|
|
31979
|
-
|
|
31980
|
-
|
|
31981
|
-
|
|
31982
|
-
|
|
31983
|
-
|
|
31984
|
-
|
|
31985
|
-
|
|
31986
|
-
|
|
31976
|
+
var _a2;
|
|
31977
|
+
const query = {};
|
|
31978
|
+
if (params.createdAfter || params.createdBefore) {
|
|
31979
|
+
query.where = {
|
|
31980
|
+
createdAt: __spreadValues(__spreadValues({}, params.createdAfter && { gte: params.createdAfter }), params.createdBefore && { lte: params.createdBefore })
|
|
31981
|
+
};
|
|
31982
|
+
}
|
|
31983
|
+
if (params.sortBy) {
|
|
31984
|
+
query.orderBy = {
|
|
31985
|
+
[params.sortBy]: params.sortDirection || "asc"
|
|
31986
|
+
};
|
|
31987
|
+
}
|
|
31988
|
+
if (params.limit) {
|
|
31989
|
+
query.take = params.limit;
|
|
31990
|
+
}
|
|
31991
|
+
if (params.after) {
|
|
31992
|
+
query.after = params.after;
|
|
31993
|
+
}
|
|
31994
|
+
const res = yield sendRequest({
|
|
31995
|
+
method: "POST" /* POST */,
|
|
31996
|
+
url: `/v1/data-records/query`,
|
|
31997
|
+
data: {
|
|
31998
|
+
table: params.tableKey,
|
|
31999
|
+
query: {
|
|
32000
|
+
findMany: query
|
|
32001
|
+
}
|
|
32002
|
+
},
|
|
31987
32003
|
headers: addHeaders(options)
|
|
31988
32004
|
});
|
|
32005
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.records) {
|
|
32006
|
+
return {
|
|
32007
|
+
data: __spreadValues({
|
|
32008
|
+
records: res.data.records
|
|
32009
|
+
}, res.data.pagination && { pagination: res.data.pagination })
|
|
32010
|
+
};
|
|
32011
|
+
}
|
|
32012
|
+
return res;
|
|
31989
32013
|
});
|
|
31990
32014
|
},
|
|
31991
32015
|
createDataRecord(params, options) {
|
|
31992
32016
|
return __async(this, null, function* () {
|
|
31993
32017
|
return sendRequest({
|
|
31994
32018
|
method: "POST" /* POST */,
|
|
31995
|
-
url: `/data-records`,
|
|
32019
|
+
url: `/v1/data-records`,
|
|
31996
32020
|
data: __spreadValues({
|
|
31997
|
-
|
|
32021
|
+
table: params.table,
|
|
31998
32022
|
data: params.data
|
|
31999
32023
|
}, params.memberId && { memberId: params.memberId }),
|
|
32000
32024
|
headers: addHeaders(options)
|
|
@@ -32003,18 +32027,31 @@ var initRequest = ({
|
|
|
32003
32027
|
},
|
|
32004
32028
|
getDataRecord(params, options) {
|
|
32005
32029
|
return __async(this, null, function* () {
|
|
32006
|
-
|
|
32007
|
-
|
|
32008
|
-
|
|
32030
|
+
var _a2;
|
|
32031
|
+
const res = yield sendRequest({
|
|
32032
|
+
method: "POST" /* POST */,
|
|
32033
|
+
url: `/v1/data-records/query`,
|
|
32034
|
+
data: {
|
|
32035
|
+
table: params.table,
|
|
32036
|
+
query: {
|
|
32037
|
+
findUnique: {
|
|
32038
|
+
where: { id: params.recordId }
|
|
32039
|
+
}
|
|
32040
|
+
}
|
|
32041
|
+
},
|
|
32009
32042
|
headers: addHeaders(options)
|
|
32010
32043
|
});
|
|
32044
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.record) {
|
|
32045
|
+
return { data: res.data.record };
|
|
32046
|
+
}
|
|
32047
|
+
return res;
|
|
32011
32048
|
});
|
|
32012
32049
|
},
|
|
32013
32050
|
updateDataRecord(params, options) {
|
|
32014
32051
|
return __async(this, null, function* () {
|
|
32015
32052
|
return sendRequest({
|
|
32016
32053
|
method: "PUT" /* PUT */,
|
|
32017
|
-
url: `/data-records/${params.recordId}`,
|
|
32054
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
32018
32055
|
data: {
|
|
32019
32056
|
data: params.data
|
|
32020
32057
|
},
|
|
@@ -32026,7 +32063,7 @@ var initRequest = ({
|
|
|
32026
32063
|
return __async(this, null, function* () {
|
|
32027
32064
|
return sendRequest({
|
|
32028
32065
|
method: "DELETE" /* DELETE */,
|
|
32029
|
-
url: `/data-records/${params.recordId}`,
|
|
32066
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
32030
32067
|
headers: addHeaders(options)
|
|
32031
32068
|
});
|
|
32032
32069
|
});
|
|
@@ -32035,10 +32072,12 @@ var initRequest = ({
|
|
|
32035
32072
|
return __async(this, null, function* () {
|
|
32036
32073
|
return sendRequest({
|
|
32037
32074
|
method: "POST" /* POST */,
|
|
32038
|
-
url: `/data-records/query`,
|
|
32075
|
+
url: `/v1/data-records/query`,
|
|
32039
32076
|
data: {
|
|
32040
32077
|
table: params.table,
|
|
32041
|
-
query:
|
|
32078
|
+
query: {
|
|
32079
|
+
findMany: params.query
|
|
32080
|
+
}
|
|
32042
32081
|
},
|
|
32043
32082
|
headers: addHeaders(options)
|
|
32044
32083
|
});
|
package/lib/index.mjs
CHANGED
|
@@ -30902,7 +30902,7 @@ import axios from "axios";
|
|
|
30902
30902
|
|
|
30903
30903
|
// src/constants/endpoints.ts
|
|
30904
30904
|
var endpoints = {
|
|
30905
|
-
API: "https://
|
|
30905
|
+
API: "https://client.memberstack.com"
|
|
30906
30906
|
};
|
|
30907
30907
|
|
|
30908
30908
|
// src/methods/requests/requests.ts
|
|
@@ -31925,7 +31925,7 @@ var initRequest = ({
|
|
|
31925
31925
|
return __async(this, null, function* () {
|
|
31926
31926
|
return sendRequest({
|
|
31927
31927
|
method: "GET" /* GET */,
|
|
31928
|
-
url: `/data-tables`,
|
|
31928
|
+
url: `/v1/data-tables`,
|
|
31929
31929
|
headers: addHeaders(options)
|
|
31930
31930
|
});
|
|
31931
31931
|
});
|
|
@@ -31934,35 +31934,59 @@ var initRequest = ({
|
|
|
31934
31934
|
return __async(this, null, function* () {
|
|
31935
31935
|
return sendRequest({
|
|
31936
31936
|
method: "GET" /* GET */,
|
|
31937
|
-
url: `/data-tables/${params.tableKey}`,
|
|
31937
|
+
url: `/v1/data-tables/${params.tableKey}`,
|
|
31938
31938
|
headers: addHeaders(options)
|
|
31939
31939
|
});
|
|
31940
31940
|
});
|
|
31941
31941
|
},
|
|
31942
31942
|
getDataRecords(params, options) {
|
|
31943
31943
|
return __async(this, null, function* () {
|
|
31944
|
-
|
|
31945
|
-
|
|
31946
|
-
|
|
31947
|
-
|
|
31948
|
-
|
|
31949
|
-
|
|
31950
|
-
|
|
31951
|
-
|
|
31952
|
-
|
|
31953
|
-
|
|
31954
|
-
|
|
31944
|
+
var _a2;
|
|
31945
|
+
const query = {};
|
|
31946
|
+
if (params.createdAfter || params.createdBefore) {
|
|
31947
|
+
query.where = {
|
|
31948
|
+
createdAt: __spreadValues(__spreadValues({}, params.createdAfter && { gte: params.createdAfter }), params.createdBefore && { lte: params.createdBefore })
|
|
31949
|
+
};
|
|
31950
|
+
}
|
|
31951
|
+
if (params.sortBy) {
|
|
31952
|
+
query.orderBy = {
|
|
31953
|
+
[params.sortBy]: params.sortDirection || "asc"
|
|
31954
|
+
};
|
|
31955
|
+
}
|
|
31956
|
+
if (params.limit) {
|
|
31957
|
+
query.take = params.limit;
|
|
31958
|
+
}
|
|
31959
|
+
if (params.after) {
|
|
31960
|
+
query.after = params.after;
|
|
31961
|
+
}
|
|
31962
|
+
const res = yield sendRequest({
|
|
31963
|
+
method: "POST" /* POST */,
|
|
31964
|
+
url: `/v1/data-records/query`,
|
|
31965
|
+
data: {
|
|
31966
|
+
table: params.tableKey,
|
|
31967
|
+
query: {
|
|
31968
|
+
findMany: query
|
|
31969
|
+
}
|
|
31970
|
+
},
|
|
31955
31971
|
headers: addHeaders(options)
|
|
31956
31972
|
});
|
|
31973
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.records) {
|
|
31974
|
+
return {
|
|
31975
|
+
data: __spreadValues({
|
|
31976
|
+
records: res.data.records
|
|
31977
|
+
}, res.data.pagination && { pagination: res.data.pagination })
|
|
31978
|
+
};
|
|
31979
|
+
}
|
|
31980
|
+
return res;
|
|
31957
31981
|
});
|
|
31958
31982
|
},
|
|
31959
31983
|
createDataRecord(params, options) {
|
|
31960
31984
|
return __async(this, null, function* () {
|
|
31961
31985
|
return sendRequest({
|
|
31962
31986
|
method: "POST" /* POST */,
|
|
31963
|
-
url: `/data-records`,
|
|
31987
|
+
url: `/v1/data-records`,
|
|
31964
31988
|
data: __spreadValues({
|
|
31965
|
-
|
|
31989
|
+
table: params.table,
|
|
31966
31990
|
data: params.data
|
|
31967
31991
|
}, params.memberId && { memberId: params.memberId }),
|
|
31968
31992
|
headers: addHeaders(options)
|
|
@@ -31971,18 +31995,31 @@ var initRequest = ({
|
|
|
31971
31995
|
},
|
|
31972
31996
|
getDataRecord(params, options) {
|
|
31973
31997
|
return __async(this, null, function* () {
|
|
31974
|
-
|
|
31975
|
-
|
|
31976
|
-
|
|
31998
|
+
var _a2;
|
|
31999
|
+
const res = yield sendRequest({
|
|
32000
|
+
method: "POST" /* POST */,
|
|
32001
|
+
url: `/v1/data-records/query`,
|
|
32002
|
+
data: {
|
|
32003
|
+
table: params.table,
|
|
32004
|
+
query: {
|
|
32005
|
+
findUnique: {
|
|
32006
|
+
where: { id: params.recordId }
|
|
32007
|
+
}
|
|
32008
|
+
}
|
|
32009
|
+
},
|
|
31977
32010
|
headers: addHeaders(options)
|
|
31978
32011
|
});
|
|
32012
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.record) {
|
|
32013
|
+
return { data: res.data.record };
|
|
32014
|
+
}
|
|
32015
|
+
return res;
|
|
31979
32016
|
});
|
|
31980
32017
|
},
|
|
31981
32018
|
updateDataRecord(params, options) {
|
|
31982
32019
|
return __async(this, null, function* () {
|
|
31983
32020
|
return sendRequest({
|
|
31984
32021
|
method: "PUT" /* PUT */,
|
|
31985
|
-
url: `/data-records/${params.recordId}`,
|
|
32022
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
31986
32023
|
data: {
|
|
31987
32024
|
data: params.data
|
|
31988
32025
|
},
|
|
@@ -31994,7 +32031,7 @@ var initRequest = ({
|
|
|
31994
32031
|
return __async(this, null, function* () {
|
|
31995
32032
|
return sendRequest({
|
|
31996
32033
|
method: "DELETE" /* DELETE */,
|
|
31997
|
-
url: `/data-records/${params.recordId}`,
|
|
32034
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
31998
32035
|
headers: addHeaders(options)
|
|
31999
32036
|
});
|
|
32000
32037
|
});
|
|
@@ -32003,10 +32040,12 @@ var initRequest = ({
|
|
|
32003
32040
|
return __async(this, null, function* () {
|
|
32004
32041
|
return sendRequest({
|
|
32005
32042
|
method: "POST" /* POST */,
|
|
32006
|
-
url: `/data-records/query`,
|
|
32043
|
+
url: `/v1/data-records/query`,
|
|
32007
32044
|
data: {
|
|
32008
32045
|
table: params.table,
|
|
32009
|
-
query:
|
|
32046
|
+
query: {
|
|
32047
|
+
findMany: params.query
|
|
32048
|
+
}
|
|
32010
32049
|
},
|
|
32011
32050
|
headers: addHeaders(options)
|
|
32012
32051
|
});
|
package/lib/methods/index.js
CHANGED
|
@@ -30934,7 +30934,7 @@ var import_axios = __toESM(require("axios"));
|
|
|
30934
30934
|
|
|
30935
30935
|
// src/constants/endpoints.ts
|
|
30936
30936
|
var endpoints = {
|
|
30937
|
-
API: "https://
|
|
30937
|
+
API: "https://client.memberstack.com"
|
|
30938
30938
|
};
|
|
30939
30939
|
|
|
30940
30940
|
// src/methods/requests/requests.ts
|
|
@@ -31957,7 +31957,7 @@ var initRequest = ({
|
|
|
31957
31957
|
return __async(this, null, function* () {
|
|
31958
31958
|
return sendRequest({
|
|
31959
31959
|
method: "GET" /* GET */,
|
|
31960
|
-
url: `/data-tables`,
|
|
31960
|
+
url: `/v1/data-tables`,
|
|
31961
31961
|
headers: addHeaders(options)
|
|
31962
31962
|
});
|
|
31963
31963
|
});
|
|
@@ -31966,35 +31966,59 @@ var initRequest = ({
|
|
|
31966
31966
|
return __async(this, null, function* () {
|
|
31967
31967
|
return sendRequest({
|
|
31968
31968
|
method: "GET" /* GET */,
|
|
31969
|
-
url: `/data-tables/${params.tableKey}`,
|
|
31969
|
+
url: `/v1/data-tables/${params.tableKey}`,
|
|
31970
31970
|
headers: addHeaders(options)
|
|
31971
31971
|
});
|
|
31972
31972
|
});
|
|
31973
31973
|
},
|
|
31974
31974
|
getDataRecords(params, options) {
|
|
31975
31975
|
return __async(this, null, function* () {
|
|
31976
|
-
|
|
31977
|
-
|
|
31978
|
-
|
|
31979
|
-
|
|
31980
|
-
|
|
31981
|
-
|
|
31982
|
-
|
|
31983
|
-
|
|
31984
|
-
|
|
31985
|
-
|
|
31986
|
-
|
|
31976
|
+
var _a2;
|
|
31977
|
+
const query = {};
|
|
31978
|
+
if (params.createdAfter || params.createdBefore) {
|
|
31979
|
+
query.where = {
|
|
31980
|
+
createdAt: __spreadValues(__spreadValues({}, params.createdAfter && { gte: params.createdAfter }), params.createdBefore && { lte: params.createdBefore })
|
|
31981
|
+
};
|
|
31982
|
+
}
|
|
31983
|
+
if (params.sortBy) {
|
|
31984
|
+
query.orderBy = {
|
|
31985
|
+
[params.sortBy]: params.sortDirection || "asc"
|
|
31986
|
+
};
|
|
31987
|
+
}
|
|
31988
|
+
if (params.limit) {
|
|
31989
|
+
query.take = params.limit;
|
|
31990
|
+
}
|
|
31991
|
+
if (params.after) {
|
|
31992
|
+
query.after = params.after;
|
|
31993
|
+
}
|
|
31994
|
+
const res = yield sendRequest({
|
|
31995
|
+
method: "POST" /* POST */,
|
|
31996
|
+
url: `/v1/data-records/query`,
|
|
31997
|
+
data: {
|
|
31998
|
+
table: params.tableKey,
|
|
31999
|
+
query: {
|
|
32000
|
+
findMany: query
|
|
32001
|
+
}
|
|
32002
|
+
},
|
|
31987
32003
|
headers: addHeaders(options)
|
|
31988
32004
|
});
|
|
32005
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.records) {
|
|
32006
|
+
return {
|
|
32007
|
+
data: __spreadValues({
|
|
32008
|
+
records: res.data.records
|
|
32009
|
+
}, res.data.pagination && { pagination: res.data.pagination })
|
|
32010
|
+
};
|
|
32011
|
+
}
|
|
32012
|
+
return res;
|
|
31989
32013
|
});
|
|
31990
32014
|
},
|
|
31991
32015
|
createDataRecord(params, options) {
|
|
31992
32016
|
return __async(this, null, function* () {
|
|
31993
32017
|
return sendRequest({
|
|
31994
32018
|
method: "POST" /* POST */,
|
|
31995
|
-
url: `/data-records`,
|
|
32019
|
+
url: `/v1/data-records`,
|
|
31996
32020
|
data: __spreadValues({
|
|
31997
|
-
|
|
32021
|
+
table: params.table,
|
|
31998
32022
|
data: params.data
|
|
31999
32023
|
}, params.memberId && { memberId: params.memberId }),
|
|
32000
32024
|
headers: addHeaders(options)
|
|
@@ -32003,18 +32027,31 @@ var initRequest = ({
|
|
|
32003
32027
|
},
|
|
32004
32028
|
getDataRecord(params, options) {
|
|
32005
32029
|
return __async(this, null, function* () {
|
|
32006
|
-
|
|
32007
|
-
|
|
32008
|
-
|
|
32030
|
+
var _a2;
|
|
32031
|
+
const res = yield sendRequest({
|
|
32032
|
+
method: "POST" /* POST */,
|
|
32033
|
+
url: `/v1/data-records/query`,
|
|
32034
|
+
data: {
|
|
32035
|
+
table: params.table,
|
|
32036
|
+
query: {
|
|
32037
|
+
findUnique: {
|
|
32038
|
+
where: { id: params.recordId }
|
|
32039
|
+
}
|
|
32040
|
+
}
|
|
32041
|
+
},
|
|
32009
32042
|
headers: addHeaders(options)
|
|
32010
32043
|
});
|
|
32044
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.record) {
|
|
32045
|
+
return { data: res.data.record };
|
|
32046
|
+
}
|
|
32047
|
+
return res;
|
|
32011
32048
|
});
|
|
32012
32049
|
},
|
|
32013
32050
|
updateDataRecord(params, options) {
|
|
32014
32051
|
return __async(this, null, function* () {
|
|
32015
32052
|
return sendRequest({
|
|
32016
32053
|
method: "PUT" /* PUT */,
|
|
32017
|
-
url: `/data-records/${params.recordId}`,
|
|
32054
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
32018
32055
|
data: {
|
|
32019
32056
|
data: params.data
|
|
32020
32057
|
},
|
|
@@ -32026,7 +32063,7 @@ var initRequest = ({
|
|
|
32026
32063
|
return __async(this, null, function* () {
|
|
32027
32064
|
return sendRequest({
|
|
32028
32065
|
method: "DELETE" /* DELETE */,
|
|
32029
|
-
url: `/data-records/${params.recordId}`,
|
|
32066
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
32030
32067
|
headers: addHeaders(options)
|
|
32031
32068
|
});
|
|
32032
32069
|
});
|
|
@@ -32035,10 +32072,12 @@ var initRequest = ({
|
|
|
32035
32072
|
return __async(this, null, function* () {
|
|
32036
32073
|
return sendRequest({
|
|
32037
32074
|
method: "POST" /* POST */,
|
|
32038
|
-
url: `/data-records/query`,
|
|
32075
|
+
url: `/v1/data-records/query`,
|
|
32039
32076
|
data: {
|
|
32040
32077
|
table: params.table,
|
|
32041
|
-
query:
|
|
32078
|
+
query: {
|
|
32079
|
+
findMany: params.query
|
|
32080
|
+
}
|
|
32042
32081
|
},
|
|
32043
32082
|
headers: addHeaders(options)
|
|
32044
32083
|
});
|
package/lib/methods/index.mjs
CHANGED
|
@@ -30902,7 +30902,7 @@ import axios from "axios";
|
|
|
30902
30902
|
|
|
30903
30903
|
// src/constants/endpoints.ts
|
|
30904
30904
|
var endpoints = {
|
|
30905
|
-
API: "https://
|
|
30905
|
+
API: "https://client.memberstack.com"
|
|
30906
30906
|
};
|
|
30907
30907
|
|
|
30908
30908
|
// src/methods/requests/requests.ts
|
|
@@ -31925,7 +31925,7 @@ var initRequest = ({
|
|
|
31925
31925
|
return __async(this, null, function* () {
|
|
31926
31926
|
return sendRequest({
|
|
31927
31927
|
method: "GET" /* GET */,
|
|
31928
|
-
url: `/data-tables`,
|
|
31928
|
+
url: `/v1/data-tables`,
|
|
31929
31929
|
headers: addHeaders(options)
|
|
31930
31930
|
});
|
|
31931
31931
|
});
|
|
@@ -31934,35 +31934,59 @@ var initRequest = ({
|
|
|
31934
31934
|
return __async(this, null, function* () {
|
|
31935
31935
|
return sendRequest({
|
|
31936
31936
|
method: "GET" /* GET */,
|
|
31937
|
-
url: `/data-tables/${params.tableKey}`,
|
|
31937
|
+
url: `/v1/data-tables/${params.tableKey}`,
|
|
31938
31938
|
headers: addHeaders(options)
|
|
31939
31939
|
});
|
|
31940
31940
|
});
|
|
31941
31941
|
},
|
|
31942
31942
|
getDataRecords(params, options) {
|
|
31943
31943
|
return __async(this, null, function* () {
|
|
31944
|
-
|
|
31945
|
-
|
|
31946
|
-
|
|
31947
|
-
|
|
31948
|
-
|
|
31949
|
-
|
|
31950
|
-
|
|
31951
|
-
|
|
31952
|
-
|
|
31953
|
-
|
|
31954
|
-
|
|
31944
|
+
var _a2;
|
|
31945
|
+
const query = {};
|
|
31946
|
+
if (params.createdAfter || params.createdBefore) {
|
|
31947
|
+
query.where = {
|
|
31948
|
+
createdAt: __spreadValues(__spreadValues({}, params.createdAfter && { gte: params.createdAfter }), params.createdBefore && { lte: params.createdBefore })
|
|
31949
|
+
};
|
|
31950
|
+
}
|
|
31951
|
+
if (params.sortBy) {
|
|
31952
|
+
query.orderBy = {
|
|
31953
|
+
[params.sortBy]: params.sortDirection || "asc"
|
|
31954
|
+
};
|
|
31955
|
+
}
|
|
31956
|
+
if (params.limit) {
|
|
31957
|
+
query.take = params.limit;
|
|
31958
|
+
}
|
|
31959
|
+
if (params.after) {
|
|
31960
|
+
query.after = params.after;
|
|
31961
|
+
}
|
|
31962
|
+
const res = yield sendRequest({
|
|
31963
|
+
method: "POST" /* POST */,
|
|
31964
|
+
url: `/v1/data-records/query`,
|
|
31965
|
+
data: {
|
|
31966
|
+
table: params.tableKey,
|
|
31967
|
+
query: {
|
|
31968
|
+
findMany: query
|
|
31969
|
+
}
|
|
31970
|
+
},
|
|
31955
31971
|
headers: addHeaders(options)
|
|
31956
31972
|
});
|
|
31973
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.records) {
|
|
31974
|
+
return {
|
|
31975
|
+
data: __spreadValues({
|
|
31976
|
+
records: res.data.records
|
|
31977
|
+
}, res.data.pagination && { pagination: res.data.pagination })
|
|
31978
|
+
};
|
|
31979
|
+
}
|
|
31980
|
+
return res;
|
|
31957
31981
|
});
|
|
31958
31982
|
},
|
|
31959
31983
|
createDataRecord(params, options) {
|
|
31960
31984
|
return __async(this, null, function* () {
|
|
31961
31985
|
return sendRequest({
|
|
31962
31986
|
method: "POST" /* POST */,
|
|
31963
|
-
url: `/data-records`,
|
|
31987
|
+
url: `/v1/data-records`,
|
|
31964
31988
|
data: __spreadValues({
|
|
31965
|
-
|
|
31989
|
+
table: params.table,
|
|
31966
31990
|
data: params.data
|
|
31967
31991
|
}, params.memberId && { memberId: params.memberId }),
|
|
31968
31992
|
headers: addHeaders(options)
|
|
@@ -31971,18 +31995,31 @@ var initRequest = ({
|
|
|
31971
31995
|
},
|
|
31972
31996
|
getDataRecord(params, options) {
|
|
31973
31997
|
return __async(this, null, function* () {
|
|
31974
|
-
|
|
31975
|
-
|
|
31976
|
-
|
|
31998
|
+
var _a2;
|
|
31999
|
+
const res = yield sendRequest({
|
|
32000
|
+
method: "POST" /* POST */,
|
|
32001
|
+
url: `/v1/data-records/query`,
|
|
32002
|
+
data: {
|
|
32003
|
+
table: params.table,
|
|
32004
|
+
query: {
|
|
32005
|
+
findUnique: {
|
|
32006
|
+
where: { id: params.recordId }
|
|
32007
|
+
}
|
|
32008
|
+
}
|
|
32009
|
+
},
|
|
31977
32010
|
headers: addHeaders(options)
|
|
31978
32011
|
});
|
|
32012
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.record) {
|
|
32013
|
+
return { data: res.data.record };
|
|
32014
|
+
}
|
|
32015
|
+
return res;
|
|
31979
32016
|
});
|
|
31980
32017
|
},
|
|
31981
32018
|
updateDataRecord(params, options) {
|
|
31982
32019
|
return __async(this, null, function* () {
|
|
31983
32020
|
return sendRequest({
|
|
31984
32021
|
method: "PUT" /* PUT */,
|
|
31985
|
-
url: `/data-records/${params.recordId}`,
|
|
32022
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
31986
32023
|
data: {
|
|
31987
32024
|
data: params.data
|
|
31988
32025
|
},
|
|
@@ -31994,7 +32031,7 @@ var initRequest = ({
|
|
|
31994
32031
|
return __async(this, null, function* () {
|
|
31995
32032
|
return sendRequest({
|
|
31996
32033
|
method: "DELETE" /* DELETE */,
|
|
31997
|
-
url: `/data-records/${params.recordId}`,
|
|
32034
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
31998
32035
|
headers: addHeaders(options)
|
|
31999
32036
|
});
|
|
32000
32037
|
});
|
|
@@ -32003,10 +32040,12 @@ var initRequest = ({
|
|
|
32003
32040
|
return __async(this, null, function* () {
|
|
32004
32041
|
return sendRequest({
|
|
32005
32042
|
method: "POST" /* POST */,
|
|
32006
|
-
url: `/data-records/query`,
|
|
32043
|
+
url: `/v1/data-records/query`,
|
|
32007
32044
|
data: {
|
|
32008
32045
|
table: params.table,
|
|
32009
|
-
query:
|
|
32046
|
+
query: {
|
|
32047
|
+
findMany: params.query
|
|
32048
|
+
}
|
|
32010
32049
|
},
|
|
32011
32050
|
headers: addHeaders(options)
|
|
32012
32051
|
});
|
|
@@ -76,7 +76,7 @@ var import_axios = __toESM(require("axios"));
|
|
|
76
76
|
|
|
77
77
|
// src/constants/endpoints.ts
|
|
78
78
|
var endpoints = {
|
|
79
|
-
API: "https://
|
|
79
|
+
API: "https://client.memberstack.com"
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
// src/utils/cookies.ts
|
|
@@ -1185,7 +1185,7 @@ var initRequest = ({
|
|
|
1185
1185
|
return __async(this, null, function* () {
|
|
1186
1186
|
return sendRequest({
|
|
1187
1187
|
method: "GET" /* GET */,
|
|
1188
|
-
url: `/data-tables`,
|
|
1188
|
+
url: `/v1/data-tables`,
|
|
1189
1189
|
headers: addHeaders(options)
|
|
1190
1190
|
});
|
|
1191
1191
|
});
|
|
@@ -1194,35 +1194,59 @@ var initRequest = ({
|
|
|
1194
1194
|
return __async(this, null, function* () {
|
|
1195
1195
|
return sendRequest({
|
|
1196
1196
|
method: "GET" /* GET */,
|
|
1197
|
-
url: `/data-tables/${params.tableKey}`,
|
|
1197
|
+
url: `/v1/data-tables/${params.tableKey}`,
|
|
1198
1198
|
headers: addHeaders(options)
|
|
1199
1199
|
});
|
|
1200
1200
|
});
|
|
1201
1201
|
},
|
|
1202
1202
|
getDataRecords(params, options) {
|
|
1203
1203
|
return __async(this, null, function* () {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1204
|
+
var _a2;
|
|
1205
|
+
const query = {};
|
|
1206
|
+
if (params.createdAfter || params.createdBefore) {
|
|
1207
|
+
query.where = {
|
|
1208
|
+
createdAt: __spreadValues(__spreadValues({}, params.createdAfter && { gte: params.createdAfter }), params.createdBefore && { lte: params.createdBefore })
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
if (params.sortBy) {
|
|
1212
|
+
query.orderBy = {
|
|
1213
|
+
[params.sortBy]: params.sortDirection || "asc"
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
if (params.limit) {
|
|
1217
|
+
query.take = params.limit;
|
|
1218
|
+
}
|
|
1219
|
+
if (params.after) {
|
|
1220
|
+
query.after = params.after;
|
|
1221
|
+
}
|
|
1222
|
+
const res = yield sendRequest({
|
|
1223
|
+
method: "POST" /* POST */,
|
|
1224
|
+
url: `/v1/data-records/query`,
|
|
1225
|
+
data: {
|
|
1226
|
+
table: params.tableKey,
|
|
1227
|
+
query: {
|
|
1228
|
+
findMany: query
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1215
1231
|
headers: addHeaders(options)
|
|
1216
1232
|
});
|
|
1233
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.records) {
|
|
1234
|
+
return {
|
|
1235
|
+
data: __spreadValues({
|
|
1236
|
+
records: res.data.records
|
|
1237
|
+
}, res.data.pagination && { pagination: res.data.pagination })
|
|
1238
|
+
};
|
|
1239
|
+
}
|
|
1240
|
+
return res;
|
|
1217
1241
|
});
|
|
1218
1242
|
},
|
|
1219
1243
|
createDataRecord(params, options) {
|
|
1220
1244
|
return __async(this, null, function* () {
|
|
1221
1245
|
return sendRequest({
|
|
1222
1246
|
method: "POST" /* POST */,
|
|
1223
|
-
url: `/data-records`,
|
|
1247
|
+
url: `/v1/data-records`,
|
|
1224
1248
|
data: __spreadValues({
|
|
1225
|
-
|
|
1249
|
+
table: params.table,
|
|
1226
1250
|
data: params.data
|
|
1227
1251
|
}, params.memberId && { memberId: params.memberId }),
|
|
1228
1252
|
headers: addHeaders(options)
|
|
@@ -1231,18 +1255,31 @@ var initRequest = ({
|
|
|
1231
1255
|
},
|
|
1232
1256
|
getDataRecord(params, options) {
|
|
1233
1257
|
return __async(this, null, function* () {
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1258
|
+
var _a2;
|
|
1259
|
+
const res = yield sendRequest({
|
|
1260
|
+
method: "POST" /* POST */,
|
|
1261
|
+
url: `/v1/data-records/query`,
|
|
1262
|
+
data: {
|
|
1263
|
+
table: params.table,
|
|
1264
|
+
query: {
|
|
1265
|
+
findUnique: {
|
|
1266
|
+
where: { id: params.recordId }
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
},
|
|
1237
1270
|
headers: addHeaders(options)
|
|
1238
1271
|
});
|
|
1272
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.record) {
|
|
1273
|
+
return { data: res.data.record };
|
|
1274
|
+
}
|
|
1275
|
+
return res;
|
|
1239
1276
|
});
|
|
1240
1277
|
},
|
|
1241
1278
|
updateDataRecord(params, options) {
|
|
1242
1279
|
return __async(this, null, function* () {
|
|
1243
1280
|
return sendRequest({
|
|
1244
1281
|
method: "PUT" /* PUT */,
|
|
1245
|
-
url: `/data-records/${params.recordId}`,
|
|
1282
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
1246
1283
|
data: {
|
|
1247
1284
|
data: params.data
|
|
1248
1285
|
},
|
|
@@ -1254,7 +1291,7 @@ var initRequest = ({
|
|
|
1254
1291
|
return __async(this, null, function* () {
|
|
1255
1292
|
return sendRequest({
|
|
1256
1293
|
method: "DELETE" /* DELETE */,
|
|
1257
|
-
url: `/data-records/${params.recordId}`,
|
|
1294
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
1258
1295
|
headers: addHeaders(options)
|
|
1259
1296
|
});
|
|
1260
1297
|
});
|
|
@@ -1263,10 +1300,12 @@ var initRequest = ({
|
|
|
1263
1300
|
return __async(this, null, function* () {
|
|
1264
1301
|
return sendRequest({
|
|
1265
1302
|
method: "POST" /* POST */,
|
|
1266
|
-
url: `/data-records/query`,
|
|
1303
|
+
url: `/v1/data-records/query`,
|
|
1267
1304
|
data: {
|
|
1268
1305
|
table: params.table,
|
|
1269
|
-
query:
|
|
1306
|
+
query: {
|
|
1307
|
+
findMany: params.query
|
|
1308
|
+
}
|
|
1270
1309
|
},
|
|
1271
1310
|
headers: addHeaders(options)
|
|
1272
1311
|
});
|
|
@@ -43,7 +43,7 @@ import axios from "axios";
|
|
|
43
43
|
|
|
44
44
|
// src/constants/endpoints.ts
|
|
45
45
|
var endpoints = {
|
|
46
|
-
API: "https://
|
|
46
|
+
API: "https://client.memberstack.com"
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
// src/utils/cookies.ts
|
|
@@ -1152,7 +1152,7 @@ var initRequest = ({
|
|
|
1152
1152
|
return __async(this, null, function* () {
|
|
1153
1153
|
return sendRequest({
|
|
1154
1154
|
method: "GET" /* GET */,
|
|
1155
|
-
url: `/data-tables`,
|
|
1155
|
+
url: `/v1/data-tables`,
|
|
1156
1156
|
headers: addHeaders(options)
|
|
1157
1157
|
});
|
|
1158
1158
|
});
|
|
@@ -1161,35 +1161,59 @@ var initRequest = ({
|
|
|
1161
1161
|
return __async(this, null, function* () {
|
|
1162
1162
|
return sendRequest({
|
|
1163
1163
|
method: "GET" /* GET */,
|
|
1164
|
-
url: `/data-tables/${params.tableKey}`,
|
|
1164
|
+
url: `/v1/data-tables/${params.tableKey}`,
|
|
1165
1165
|
headers: addHeaders(options)
|
|
1166
1166
|
});
|
|
1167
1167
|
});
|
|
1168
1168
|
},
|
|
1169
1169
|
getDataRecords(params, options) {
|
|
1170
1170
|
return __async(this, null, function* () {
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1171
|
+
var _a2;
|
|
1172
|
+
const query = {};
|
|
1173
|
+
if (params.createdAfter || params.createdBefore) {
|
|
1174
|
+
query.where = {
|
|
1175
|
+
createdAt: __spreadValues(__spreadValues({}, params.createdAfter && { gte: params.createdAfter }), params.createdBefore && { lte: params.createdBefore })
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
if (params.sortBy) {
|
|
1179
|
+
query.orderBy = {
|
|
1180
|
+
[params.sortBy]: params.sortDirection || "asc"
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
if (params.limit) {
|
|
1184
|
+
query.take = params.limit;
|
|
1185
|
+
}
|
|
1186
|
+
if (params.after) {
|
|
1187
|
+
query.after = params.after;
|
|
1188
|
+
}
|
|
1189
|
+
const res = yield sendRequest({
|
|
1190
|
+
method: "POST" /* POST */,
|
|
1191
|
+
url: `/v1/data-records/query`,
|
|
1192
|
+
data: {
|
|
1193
|
+
table: params.tableKey,
|
|
1194
|
+
query: {
|
|
1195
|
+
findMany: query
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1182
1198
|
headers: addHeaders(options)
|
|
1183
1199
|
});
|
|
1200
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.records) {
|
|
1201
|
+
return {
|
|
1202
|
+
data: __spreadValues({
|
|
1203
|
+
records: res.data.records
|
|
1204
|
+
}, res.data.pagination && { pagination: res.data.pagination })
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
return res;
|
|
1184
1208
|
});
|
|
1185
1209
|
},
|
|
1186
1210
|
createDataRecord(params, options) {
|
|
1187
1211
|
return __async(this, null, function* () {
|
|
1188
1212
|
return sendRequest({
|
|
1189
1213
|
method: "POST" /* POST */,
|
|
1190
|
-
url: `/data-records`,
|
|
1214
|
+
url: `/v1/data-records`,
|
|
1191
1215
|
data: __spreadValues({
|
|
1192
|
-
|
|
1216
|
+
table: params.table,
|
|
1193
1217
|
data: params.data
|
|
1194
1218
|
}, params.memberId && { memberId: params.memberId }),
|
|
1195
1219
|
headers: addHeaders(options)
|
|
@@ -1198,18 +1222,31 @@ var initRequest = ({
|
|
|
1198
1222
|
},
|
|
1199
1223
|
getDataRecord(params, options) {
|
|
1200
1224
|
return __async(this, null, function* () {
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1225
|
+
var _a2;
|
|
1226
|
+
const res = yield sendRequest({
|
|
1227
|
+
method: "POST" /* POST */,
|
|
1228
|
+
url: `/v1/data-records/query`,
|
|
1229
|
+
data: {
|
|
1230
|
+
table: params.table,
|
|
1231
|
+
query: {
|
|
1232
|
+
findUnique: {
|
|
1233
|
+
where: { id: params.recordId }
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
},
|
|
1204
1237
|
headers: addHeaders(options)
|
|
1205
1238
|
});
|
|
1239
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.record) {
|
|
1240
|
+
return { data: res.data.record };
|
|
1241
|
+
}
|
|
1242
|
+
return res;
|
|
1206
1243
|
});
|
|
1207
1244
|
},
|
|
1208
1245
|
updateDataRecord(params, options) {
|
|
1209
1246
|
return __async(this, null, function* () {
|
|
1210
1247
|
return sendRequest({
|
|
1211
1248
|
method: "PUT" /* PUT */,
|
|
1212
|
-
url: `/data-records/${params.recordId}`,
|
|
1249
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
1213
1250
|
data: {
|
|
1214
1251
|
data: params.data
|
|
1215
1252
|
},
|
|
@@ -1221,7 +1258,7 @@ var initRequest = ({
|
|
|
1221
1258
|
return __async(this, null, function* () {
|
|
1222
1259
|
return sendRequest({
|
|
1223
1260
|
method: "DELETE" /* DELETE */,
|
|
1224
|
-
url: `/data-records/${params.recordId}`,
|
|
1261
|
+
url: `/v1/data-records/${params.recordId}`,
|
|
1225
1262
|
headers: addHeaders(options)
|
|
1226
1263
|
});
|
|
1227
1264
|
});
|
|
@@ -1230,10 +1267,12 @@ var initRequest = ({
|
|
|
1230
1267
|
return __async(this, null, function* () {
|
|
1231
1268
|
return sendRequest({
|
|
1232
1269
|
method: "POST" /* POST */,
|
|
1233
|
-
url: `/data-records/query`,
|
|
1270
|
+
url: `/v1/data-records/query`,
|
|
1234
1271
|
data: {
|
|
1235
1272
|
table: params.table,
|
|
1236
|
-
query:
|
|
1273
|
+
query: {
|
|
1274
|
+
findMany: params.query
|
|
1275
|
+
}
|
|
1237
1276
|
},
|
|
1238
1277
|
headers: addHeaders(options)
|
|
1239
1278
|
});
|
package/lib/types/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AddMemberCardParams, AddPlanParams, CancelPlanParams, CountClause, CreateDataRecordParams, CreatePostParams, CreateThreadParams, DataRecordsQuery, DeleteDataRecordParams, DeletePostParams, DeleteThreadParams, GenerateInviteTokenParams, GetAuthenticationClientSecretParams, GetDataRecordParams, GetDataRecordsParams, GetDataTableParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlanParams, GetPlansParams, GetPostsParams, GetSecureContentParams, GetTeamParams, GetThreadsParams, GetTotalCheckoutAmountParams, IncludeClause, JoinTeamParams, LaunchStripeCustomerPortalParams, LoginMemberEmailPasswordParams, LoginMemberPasswordlessParams, LoginWithProviderParams, OpenStripeCustomerPortalParams, OrderByClause, PostVoteParams, PurchasePlansParams, PurchasePlansWithCheckoutParams, QueryDataRecordsParams, RemoveMemberFromTeamParams, RemovePlanParams, ReplacePlanParams, ResetMemberPasswordParams, SelectClause, SendMemberLoginPasswordlessEmailParams, SendMemberResetPasswordEmailParams, SetPasswordParams, SignupMemberAuthProviderParams, SignupMemberEmailPasswordParams, SignupWithProviderParams, ThreadVoteParams, UpdateDataRecordParams, UpdateDefaultCardParams, UpdateMemberAuthParams, UpdateMemberJSONParams, UpdateMemberParams, UpdateMemberProfileImageParams, UpdatePlanPaymentParams, UpdatePostParams, UpdateThreadParams, WhereClause, WhereOperators } from './params.mjs';
|
|
2
|
-
export { AddMemberCardPayload, AddPlanPayload, AppPayload, CancelPlanPayload, ConnectProviderPayload, CreateDataRecordPayload, CreatePostPayload, CreateThreadPayload, DeleteDataRecordPayload, DeleteMemberPayload, GetAppAndMemberPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetCurrentMemberPayload, GetDataRecordPayload, GetDataRecordsPayload, GetDataTablePayload, GetDataTablesPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberJSONPayload, GetMemberReceiptsPayload, GetPlanPayload, GetPlansPayload, GetPostsPayload, GetRestrictedUrlGroupsPayload, GetSecureContentPayload, GetThreadsPayload, GetTotalCheckoutAmountPayload, LaunchStripeCustomerPortalPayload, LoginMemberEmailPasswordPayload, LogoutMemberPayload, OpenStripeCustomerPortalPayload, PurchasePlansPayload, PurchasePlansWithCheckoutPayload, QueryDataRecordsPayload, RefreshMemberTokensPayload, RemovePlanPayload, ReplacePlanPayload, ResetMemberPassworPayload, SendMemberLoginPasswordlessEmailPayload, SendMemberResetPasswordEmailPayload, SendMemberVerificationEmailPayload, SetPasswordPayload, SignupMemberAuthProviderPayload, SignupMemberEmailPasswordPayload, UpdateDataRecordPayload, UpdateDefaultCardPayload, UpdateMemberAuthPayload, UpdateMemberPayload, UpdateMemberProfileImagePayload, UpdatePlanPaymentPayload, UpdatePostPayload, UpdateThreadPayload } from './payloads.mjs';
|
|
1
|
+
export { AddMemberCardParams, AddPlanParams, CancelPlanParams, CountClause, CreateDataRecordParams, CreatePostParams, CreateThreadParams, DataRecordsQuery, DeleteDataRecordParams, DeletePostParams, DeleteThreadParams, GenerateInviteTokenParams, GetAuthenticationClientSecretParams, GetDataRecordParams, GetDataRecordsParams, GetDataTableParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlanParams, GetPlansParams, GetPostsParams, GetSecureContentParams, GetTeamParams, GetThreadsParams, GetTotalCheckoutAmountParams, IncludeClause, JoinTeamParams, LaunchStripeCustomerPortalParams, LoginMemberEmailPasswordParams, LoginMemberPasswordlessParams, LoginWithProviderParams, MemberReferenceOperation, MemberReferenceSelector, OpenStripeCustomerPortalParams, OrderByClause, PostVoteParams, PurchasePlansParams, PurchasePlansWithCheckoutParams, QueryDataRecordsParams, ReferenceOperation, ReferenceSelector, RemoveMemberFromTeamParams, RemovePlanParams, ReplacePlanParams, ResetMemberPasswordParams, SelectClause, SendMemberLoginPasswordlessEmailParams, SendMemberResetPasswordEmailParams, SetPasswordParams, SignupMemberAuthProviderParams, SignupMemberEmailPasswordParams, SignupWithProviderParams, ThreadVoteParams, UpdateDataRecordParams, UpdateDefaultCardParams, UpdateMemberAuthParams, UpdateMemberJSONParams, UpdateMemberParams, UpdateMemberProfileImageParams, UpdatePlanPaymentParams, UpdatePostParams, UpdateThreadParams, WhereClause, WhereOperators } from './params.mjs';
|
|
2
|
+
export { AddMemberCardPayload, AddPlanPayload, AppPayload, CancelPlanPayload, ConnectProviderPayload, CreateDataRecordPayload, CreatePostPayload, CreateThreadPayload, DeleteDataRecordPayload, DeleteMemberPayload, GetAppAndMemberPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetCurrentMemberPayload, GetDataRecordPayload, GetDataRecordsPayload, GetDataTablePayload, GetDataTablesPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberJSONPayload, GetMemberReceiptsPayload, GetPlanPayload, GetPlansPayload, GetPostsPayload, GetRestrictedUrlGroupsPayload, GetSecureContentPayload, GetThreadsPayload, GetTotalCheckoutAmountPayload, LaunchStripeCustomerPortalPayload, LoginMemberEmailPasswordPayload, LogoutMemberPayload, MemberReferenceFieldResult, OpenStripeCustomerPortalPayload, PurchasePlansPayload, PurchasePlansWithCheckoutPayload, QueryDataRecordsPayload, ReferenceFieldResult, RefreshMemberTokensPayload, RemovePlanPayload, ReplacePlanPayload, ResetMemberPassworPayload, SendMemberLoginPasswordlessEmailPayload, SendMemberResetPasswordEmailPayload, SendMemberVerificationEmailPayload, SetPasswordPayload, SignupMemberAuthProviderPayload, SignupMemberEmailPasswordPayload, UpdateDataRecordPayload, UpdateDefaultCardPayload, UpdateMemberAuthPayload, UpdateMemberPayload, UpdateMemberProfileImagePayload, UpdatePlanPaymentPayload, UpdatePostPayload, UpdateThreadPayload } from './payloads.mjs';
|
|
3
3
|
export { MemberstackTranslations } from './translations.mjs';
|
|
4
4
|
import './utils/payloads.mjs';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AddMemberCardParams, AddPlanParams, CancelPlanParams, CountClause, CreateDataRecordParams, CreatePostParams, CreateThreadParams, DataRecordsQuery, DeleteDataRecordParams, DeletePostParams, DeleteThreadParams, GenerateInviteTokenParams, GetAuthenticationClientSecretParams, GetDataRecordParams, GetDataRecordsParams, GetDataTableParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlanParams, GetPlansParams, GetPostsParams, GetSecureContentParams, GetTeamParams, GetThreadsParams, GetTotalCheckoutAmountParams, IncludeClause, JoinTeamParams, LaunchStripeCustomerPortalParams, LoginMemberEmailPasswordParams, LoginMemberPasswordlessParams, LoginWithProviderParams, OpenStripeCustomerPortalParams, OrderByClause, PostVoteParams, PurchasePlansParams, PurchasePlansWithCheckoutParams, QueryDataRecordsParams, RemoveMemberFromTeamParams, RemovePlanParams, ReplacePlanParams, ResetMemberPasswordParams, SelectClause, SendMemberLoginPasswordlessEmailParams, SendMemberResetPasswordEmailParams, SetPasswordParams, SignupMemberAuthProviderParams, SignupMemberEmailPasswordParams, SignupWithProviderParams, ThreadVoteParams, UpdateDataRecordParams, UpdateDefaultCardParams, UpdateMemberAuthParams, UpdateMemberJSONParams, UpdateMemberParams, UpdateMemberProfileImageParams, UpdatePlanPaymentParams, UpdatePostParams, UpdateThreadParams, WhereClause, WhereOperators } from './params.js';
|
|
2
|
-
export { AddMemberCardPayload, AddPlanPayload, AppPayload, CancelPlanPayload, ConnectProviderPayload, CreateDataRecordPayload, CreatePostPayload, CreateThreadPayload, DeleteDataRecordPayload, DeleteMemberPayload, GetAppAndMemberPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetCurrentMemberPayload, GetDataRecordPayload, GetDataRecordsPayload, GetDataTablePayload, GetDataTablesPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberJSONPayload, GetMemberReceiptsPayload, GetPlanPayload, GetPlansPayload, GetPostsPayload, GetRestrictedUrlGroupsPayload, GetSecureContentPayload, GetThreadsPayload, GetTotalCheckoutAmountPayload, LaunchStripeCustomerPortalPayload, LoginMemberEmailPasswordPayload, LogoutMemberPayload, OpenStripeCustomerPortalPayload, PurchasePlansPayload, PurchasePlansWithCheckoutPayload, QueryDataRecordsPayload, RefreshMemberTokensPayload, RemovePlanPayload, ReplacePlanPayload, ResetMemberPassworPayload, SendMemberLoginPasswordlessEmailPayload, SendMemberResetPasswordEmailPayload, SendMemberVerificationEmailPayload, SetPasswordPayload, SignupMemberAuthProviderPayload, SignupMemberEmailPasswordPayload, UpdateDataRecordPayload, UpdateDefaultCardPayload, UpdateMemberAuthPayload, UpdateMemberPayload, UpdateMemberProfileImagePayload, UpdatePlanPaymentPayload, UpdatePostPayload, UpdateThreadPayload } from './payloads.js';
|
|
1
|
+
export { AddMemberCardParams, AddPlanParams, CancelPlanParams, CountClause, CreateDataRecordParams, CreatePostParams, CreateThreadParams, DataRecordsQuery, DeleteDataRecordParams, DeletePostParams, DeleteThreadParams, GenerateInviteTokenParams, GetAuthenticationClientSecretParams, GetDataRecordParams, GetDataRecordsParams, GetDataTableParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlanParams, GetPlansParams, GetPostsParams, GetSecureContentParams, GetTeamParams, GetThreadsParams, GetTotalCheckoutAmountParams, IncludeClause, JoinTeamParams, LaunchStripeCustomerPortalParams, LoginMemberEmailPasswordParams, LoginMemberPasswordlessParams, LoginWithProviderParams, MemberReferenceOperation, MemberReferenceSelector, OpenStripeCustomerPortalParams, OrderByClause, PostVoteParams, PurchasePlansParams, PurchasePlansWithCheckoutParams, QueryDataRecordsParams, ReferenceOperation, ReferenceSelector, RemoveMemberFromTeamParams, RemovePlanParams, ReplacePlanParams, ResetMemberPasswordParams, SelectClause, SendMemberLoginPasswordlessEmailParams, SendMemberResetPasswordEmailParams, SetPasswordParams, SignupMemberAuthProviderParams, SignupMemberEmailPasswordParams, SignupWithProviderParams, ThreadVoteParams, UpdateDataRecordParams, UpdateDefaultCardParams, UpdateMemberAuthParams, UpdateMemberJSONParams, UpdateMemberParams, UpdateMemberProfileImageParams, UpdatePlanPaymentParams, UpdatePostParams, UpdateThreadParams, WhereClause, WhereOperators } from './params.js';
|
|
2
|
+
export { AddMemberCardPayload, AddPlanPayload, AppPayload, CancelPlanPayload, ConnectProviderPayload, CreateDataRecordPayload, CreatePostPayload, CreateThreadPayload, DeleteDataRecordPayload, DeleteMemberPayload, GetAppAndMemberPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetCurrentMemberPayload, GetDataRecordPayload, GetDataRecordsPayload, GetDataTablePayload, GetDataTablesPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberJSONPayload, GetMemberReceiptsPayload, GetPlanPayload, GetPlansPayload, GetPostsPayload, GetRestrictedUrlGroupsPayload, GetSecureContentPayload, GetThreadsPayload, GetTotalCheckoutAmountPayload, LaunchStripeCustomerPortalPayload, LoginMemberEmailPasswordPayload, LogoutMemberPayload, MemberReferenceFieldResult, OpenStripeCustomerPortalPayload, PurchasePlansPayload, PurchasePlansWithCheckoutPayload, QueryDataRecordsPayload, ReferenceFieldResult, RefreshMemberTokensPayload, RemovePlanPayload, ReplacePlanPayload, ResetMemberPassworPayload, SendMemberLoginPasswordlessEmailPayload, SendMemberResetPasswordEmailPayload, SendMemberVerificationEmailPayload, SetPasswordPayload, SignupMemberAuthProviderPayload, SignupMemberEmailPasswordPayload, UpdateDataRecordPayload, UpdateDefaultCardPayload, UpdateMemberAuthPayload, UpdateMemberPayload, UpdateMemberProfileImagePayload, UpdatePlanPaymentPayload, UpdatePostPayload, UpdateThreadPayload } from './payloads.js';
|
|
3
3
|
export { MemberstackTranslations } from './translations.js';
|
|
4
4
|
import './utils/payloads.js';
|
package/lib/types/params.d.mts
CHANGED
|
@@ -221,23 +221,36 @@ type GetTotalCheckoutAmountParams = {
|
|
|
221
221
|
};
|
|
222
222
|
type GetDataRecordsParams = {
|
|
223
223
|
tableKey: string;
|
|
224
|
-
memberId?: string;
|
|
225
224
|
createdAfter?: string;
|
|
226
225
|
createdBefore?: string;
|
|
227
226
|
sortBy?: string;
|
|
228
227
|
sortDirection?: 'ASC' | 'DESC';
|
|
229
228
|
limit?: number;
|
|
230
229
|
after?: string;
|
|
231
|
-
[key: string]: any;
|
|
232
230
|
};
|
|
233
231
|
type CreateDataRecordParams = {
|
|
234
|
-
|
|
232
|
+
table: string;
|
|
235
233
|
data: Record<string, any>;
|
|
236
234
|
memberId?: string;
|
|
237
235
|
};
|
|
238
236
|
type GetDataRecordParams = {
|
|
237
|
+
table: string;
|
|
239
238
|
recordId: string;
|
|
240
239
|
};
|
|
240
|
+
type ReferenceSelector = {
|
|
241
|
+
id: string;
|
|
242
|
+
};
|
|
243
|
+
type ReferenceOperation = {
|
|
244
|
+
connect?: ReferenceSelector | ReferenceSelector[];
|
|
245
|
+
disconnect?: ReferenceSelector | ReferenceSelector[];
|
|
246
|
+
};
|
|
247
|
+
type MemberReferenceSelector = {
|
|
248
|
+
self: true;
|
|
249
|
+
};
|
|
250
|
+
type MemberReferenceOperation = {
|
|
251
|
+
connect?: MemberReferenceSelector | MemberReferenceSelector[];
|
|
252
|
+
disconnect?: MemberReferenceSelector | MemberReferenceSelector[];
|
|
253
|
+
};
|
|
241
254
|
type UpdateDataRecordParams = {
|
|
242
255
|
recordId: string;
|
|
243
256
|
data: Record<string, any>;
|
|
@@ -306,4 +319,4 @@ type QueryDataRecordsParams = {
|
|
|
306
319
|
query: DataRecordsQuery;
|
|
307
320
|
};
|
|
308
321
|
|
|
309
|
-
export type { AddMemberCardParams, AddPlanParams, CancelPlanParams, CountClause, CreateDataRecordParams, CreatePostParams, CreateThreadParams, DataRecordsQuery, DeleteDataRecordParams, DeletePostParams, DeleteThreadParams, GenerateInviteTokenParams, GetAuthenticationClientSecretParams, GetDataRecordParams, GetDataRecordsParams, GetDataTableParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlanParams, GetPlansParams, GetPostsParams, GetSecureContentParams, GetTeamParams, GetThreadsParams, GetTotalCheckoutAmountParams, IncludeClause, JoinTeamParams, LaunchStripeCustomerPortalParams, LoginMemberEmailPasswordParams, LoginMemberPasswordlessParams, LoginWithProviderParams, OpenStripeCustomerPortalParams, OrderByClause, PostVoteParams, PurchasePlansParams, PurchasePlansWithCheckoutParams, QueryDataRecordsParams, RemoveMemberFromTeamParams, RemovePlanParams, ReplacePlanParams, ResetMemberPasswordParams, SelectClause, SendMemberLoginPasswordlessEmailParams, SendMemberResetPasswordEmailParams, SetPasswordParams, SignupMemberAuthProviderParams, SignupMemberEmailPasswordParams, SignupWithProviderParams, ThreadVoteParams, UpdateDataRecordParams, UpdateDefaultCardParams, UpdateMemberAuthParams, UpdateMemberJSONParams, UpdateMemberParams, UpdateMemberProfileImageParams, UpdatePlanPaymentParams, UpdatePostParams, UpdateThreadParams, WhereClause, WhereOperators };
|
|
322
|
+
export type { AddMemberCardParams, AddPlanParams, CancelPlanParams, CountClause, CreateDataRecordParams, CreatePostParams, CreateThreadParams, DataRecordsQuery, DeleteDataRecordParams, DeletePostParams, DeleteThreadParams, GenerateInviteTokenParams, GetAuthenticationClientSecretParams, GetDataRecordParams, GetDataRecordsParams, GetDataTableParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlanParams, GetPlansParams, GetPostsParams, GetSecureContentParams, GetTeamParams, GetThreadsParams, GetTotalCheckoutAmountParams, IncludeClause, JoinTeamParams, LaunchStripeCustomerPortalParams, LoginMemberEmailPasswordParams, LoginMemberPasswordlessParams, LoginWithProviderParams, MemberReferenceOperation, MemberReferenceSelector, OpenStripeCustomerPortalParams, OrderByClause, PostVoteParams, PurchasePlansParams, PurchasePlansWithCheckoutParams, QueryDataRecordsParams, ReferenceOperation, ReferenceSelector, RemoveMemberFromTeamParams, RemovePlanParams, ReplacePlanParams, ResetMemberPasswordParams, SelectClause, SendMemberLoginPasswordlessEmailParams, SendMemberResetPasswordEmailParams, SetPasswordParams, SignupMemberAuthProviderParams, SignupMemberEmailPasswordParams, SignupWithProviderParams, ThreadVoteParams, UpdateDataRecordParams, UpdateDefaultCardParams, UpdateMemberAuthParams, UpdateMemberJSONParams, UpdateMemberParams, UpdateMemberProfileImageParams, UpdatePlanPaymentParams, UpdatePostParams, UpdateThreadParams, WhereClause, WhereOperators };
|
package/lib/types/params.d.ts
CHANGED
|
@@ -221,23 +221,36 @@ type GetTotalCheckoutAmountParams = {
|
|
|
221
221
|
};
|
|
222
222
|
type GetDataRecordsParams = {
|
|
223
223
|
tableKey: string;
|
|
224
|
-
memberId?: string;
|
|
225
224
|
createdAfter?: string;
|
|
226
225
|
createdBefore?: string;
|
|
227
226
|
sortBy?: string;
|
|
228
227
|
sortDirection?: 'ASC' | 'DESC';
|
|
229
228
|
limit?: number;
|
|
230
229
|
after?: string;
|
|
231
|
-
[key: string]: any;
|
|
232
230
|
};
|
|
233
231
|
type CreateDataRecordParams = {
|
|
234
|
-
|
|
232
|
+
table: string;
|
|
235
233
|
data: Record<string, any>;
|
|
236
234
|
memberId?: string;
|
|
237
235
|
};
|
|
238
236
|
type GetDataRecordParams = {
|
|
237
|
+
table: string;
|
|
239
238
|
recordId: string;
|
|
240
239
|
};
|
|
240
|
+
type ReferenceSelector = {
|
|
241
|
+
id: string;
|
|
242
|
+
};
|
|
243
|
+
type ReferenceOperation = {
|
|
244
|
+
connect?: ReferenceSelector | ReferenceSelector[];
|
|
245
|
+
disconnect?: ReferenceSelector | ReferenceSelector[];
|
|
246
|
+
};
|
|
247
|
+
type MemberReferenceSelector = {
|
|
248
|
+
self: true;
|
|
249
|
+
};
|
|
250
|
+
type MemberReferenceOperation = {
|
|
251
|
+
connect?: MemberReferenceSelector | MemberReferenceSelector[];
|
|
252
|
+
disconnect?: MemberReferenceSelector | MemberReferenceSelector[];
|
|
253
|
+
};
|
|
241
254
|
type UpdateDataRecordParams = {
|
|
242
255
|
recordId: string;
|
|
243
256
|
data: Record<string, any>;
|
|
@@ -306,4 +319,4 @@ type QueryDataRecordsParams = {
|
|
|
306
319
|
query: DataRecordsQuery;
|
|
307
320
|
};
|
|
308
321
|
|
|
309
|
-
export type { AddMemberCardParams, AddPlanParams, CancelPlanParams, CountClause, CreateDataRecordParams, CreatePostParams, CreateThreadParams, DataRecordsQuery, DeleteDataRecordParams, DeletePostParams, DeleteThreadParams, GenerateInviteTokenParams, GetAuthenticationClientSecretParams, GetDataRecordParams, GetDataRecordsParams, GetDataTableParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlanParams, GetPlansParams, GetPostsParams, GetSecureContentParams, GetTeamParams, GetThreadsParams, GetTotalCheckoutAmountParams, IncludeClause, JoinTeamParams, LaunchStripeCustomerPortalParams, LoginMemberEmailPasswordParams, LoginMemberPasswordlessParams, LoginWithProviderParams, OpenStripeCustomerPortalParams, OrderByClause, PostVoteParams, PurchasePlansParams, PurchasePlansWithCheckoutParams, QueryDataRecordsParams, RemoveMemberFromTeamParams, RemovePlanParams, ReplacePlanParams, ResetMemberPasswordParams, SelectClause, SendMemberLoginPasswordlessEmailParams, SendMemberResetPasswordEmailParams, SetPasswordParams, SignupMemberAuthProviderParams, SignupMemberEmailPasswordParams, SignupWithProviderParams, ThreadVoteParams, UpdateDataRecordParams, UpdateDefaultCardParams, UpdateMemberAuthParams, UpdateMemberJSONParams, UpdateMemberParams, UpdateMemberProfileImageParams, UpdatePlanPaymentParams, UpdatePostParams, UpdateThreadParams, WhereClause, WhereOperators };
|
|
322
|
+
export type { AddMemberCardParams, AddPlanParams, CancelPlanParams, CountClause, CreateDataRecordParams, CreatePostParams, CreateThreadParams, DataRecordsQuery, DeleteDataRecordParams, DeletePostParams, DeleteThreadParams, GenerateInviteTokenParams, GetAuthenticationClientSecretParams, GetDataRecordParams, GetDataRecordsParams, GetDataTableParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlanParams, GetPlansParams, GetPostsParams, GetSecureContentParams, GetTeamParams, GetThreadsParams, GetTotalCheckoutAmountParams, IncludeClause, JoinTeamParams, LaunchStripeCustomerPortalParams, LoginMemberEmailPasswordParams, LoginMemberPasswordlessParams, LoginWithProviderParams, MemberReferenceOperation, MemberReferenceSelector, OpenStripeCustomerPortalParams, OrderByClause, PostVoteParams, PurchasePlansParams, PurchasePlansWithCheckoutParams, QueryDataRecordsParams, ReferenceOperation, ReferenceSelector, RemoveMemberFromTeamParams, RemovePlanParams, ReplacePlanParams, ResetMemberPasswordParams, SelectClause, SendMemberLoginPasswordlessEmailParams, SendMemberResetPasswordEmailParams, SetPasswordParams, SignupMemberAuthProviderParams, SignupMemberEmailPasswordParams, SignupWithProviderParams, ThreadVoteParams, UpdateDataRecordParams, UpdateDefaultCardParams, UpdateMemberAuthParams, UpdateMemberJSONParams, UpdateMemberParams, UpdateMemberProfileImageParams, UpdatePlanPaymentParams, UpdatePostParams, UpdateThreadParams, WhereClause, WhereOperators };
|
package/lib/types/payloads.d.mts
CHANGED
|
@@ -97,7 +97,6 @@ type DataTableResponse = {
|
|
|
97
97
|
name: string;
|
|
98
98
|
type: string;
|
|
99
99
|
required: boolean;
|
|
100
|
-
unique: boolean;
|
|
101
100
|
defaultValue?: any;
|
|
102
101
|
tableOrder?: number;
|
|
103
102
|
referencedTableId?: string;
|
|
@@ -111,13 +110,22 @@ type DataTableResponse = {
|
|
|
111
110
|
type DataRecordResponse = {
|
|
112
111
|
id: string;
|
|
113
112
|
tableKey: string;
|
|
114
|
-
|
|
113
|
+
createdByMemberId?: string;
|
|
115
114
|
data: Record<string, any>;
|
|
116
115
|
createdAt: string;
|
|
117
116
|
updatedAt: string;
|
|
118
117
|
internalOrder: number;
|
|
119
118
|
activeMemberOwnsIt: boolean;
|
|
120
119
|
};
|
|
120
|
+
type ReferenceFieldResult = {
|
|
121
|
+
count: number;
|
|
122
|
+
action: 'connected' | 'disconnected' | 'unchanged';
|
|
123
|
+
};
|
|
124
|
+
type MemberReferenceFieldResult = {
|
|
125
|
+
count: number;
|
|
126
|
+
hasself: boolean;
|
|
127
|
+
action: 'connected' | 'disconnected' | 'unchanged';
|
|
128
|
+
};
|
|
121
129
|
type QueryDataRecordResponse = DataRecordResponse & {
|
|
122
130
|
[relationName: string]: any;
|
|
123
131
|
_count?: Record<string, number>;
|
|
@@ -132,4 +140,4 @@ type Response<T> = {
|
|
|
132
140
|
data: T;
|
|
133
141
|
};
|
|
134
142
|
|
|
135
|
-
export type { AddMemberCardPayload, AddPlanPayload, AppPayload, CancelPlanPayload, ConnectProviderPayload, CreateDataRecordPayload, CreatePostPayload, CreateThreadPayload, DeleteDataRecordPayload, DeleteMemberPayload, GetAppAndMemberPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetCurrentMemberPayload, GetDataRecordPayload, GetDataRecordsPayload, GetDataTablePayload, GetDataTablesPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberJSONPayload, GetMemberReceiptsPayload, GetPlanPayload, GetPlansPayload, GetPostsPayload, GetRestrictedUrlGroupsPayload, GetSecureContentPayload, GetThreadsPayload, GetTotalCheckoutAmountPayload, LaunchStripeCustomerPortalPayload, LoginMemberEmailPasswordPayload, LogoutMemberPayload, OpenStripeCustomerPortalPayload, PurchasePlansPayload, PurchasePlansWithCheckoutPayload, QueryDataRecordsPayload, RefreshMemberTokensPayload, RemovePlanPayload, ReplacePlanPayload, ResetMemberPassworPayload, SendMemberLoginPasswordlessEmailPayload, SendMemberResetPasswordEmailPayload, SendMemberVerificationEmailPayload, SetPasswordPayload, SignupMemberAuthProviderPayload, SignupMemberEmailPasswordPayload, UpdateDataRecordPayload, UpdateDefaultCardPayload, UpdateMemberAuthPayload, UpdateMemberPayload, UpdateMemberProfileImagePayload, UpdatePlanPaymentPayload, UpdatePostPayload, UpdateThreadPayload };
|
|
143
|
+
export type { AddMemberCardPayload, AddPlanPayload, AppPayload, CancelPlanPayload, ConnectProviderPayload, CreateDataRecordPayload, CreatePostPayload, CreateThreadPayload, DeleteDataRecordPayload, DeleteMemberPayload, GetAppAndMemberPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetCurrentMemberPayload, GetDataRecordPayload, GetDataRecordsPayload, GetDataTablePayload, GetDataTablesPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberJSONPayload, GetMemberReceiptsPayload, GetPlanPayload, GetPlansPayload, GetPostsPayload, GetRestrictedUrlGroupsPayload, GetSecureContentPayload, GetThreadsPayload, GetTotalCheckoutAmountPayload, LaunchStripeCustomerPortalPayload, LoginMemberEmailPasswordPayload, LogoutMemberPayload, MemberReferenceFieldResult, OpenStripeCustomerPortalPayload, PurchasePlansPayload, PurchasePlansWithCheckoutPayload, QueryDataRecordsPayload, ReferenceFieldResult, RefreshMemberTokensPayload, RemovePlanPayload, ReplacePlanPayload, ResetMemberPassworPayload, SendMemberLoginPasswordlessEmailPayload, SendMemberResetPasswordEmailPayload, SendMemberVerificationEmailPayload, SetPasswordPayload, SignupMemberAuthProviderPayload, SignupMemberEmailPasswordPayload, UpdateDataRecordPayload, UpdateDefaultCardPayload, UpdateMemberAuthPayload, UpdateMemberPayload, UpdateMemberProfileImagePayload, UpdatePlanPaymentPayload, UpdatePostPayload, UpdateThreadPayload };
|
package/lib/types/payloads.d.ts
CHANGED
|
@@ -97,7 +97,6 @@ type DataTableResponse = {
|
|
|
97
97
|
name: string;
|
|
98
98
|
type: string;
|
|
99
99
|
required: boolean;
|
|
100
|
-
unique: boolean;
|
|
101
100
|
defaultValue?: any;
|
|
102
101
|
tableOrder?: number;
|
|
103
102
|
referencedTableId?: string;
|
|
@@ -111,13 +110,22 @@ type DataTableResponse = {
|
|
|
111
110
|
type DataRecordResponse = {
|
|
112
111
|
id: string;
|
|
113
112
|
tableKey: string;
|
|
114
|
-
|
|
113
|
+
createdByMemberId?: string;
|
|
115
114
|
data: Record<string, any>;
|
|
116
115
|
createdAt: string;
|
|
117
116
|
updatedAt: string;
|
|
118
117
|
internalOrder: number;
|
|
119
118
|
activeMemberOwnsIt: boolean;
|
|
120
119
|
};
|
|
120
|
+
type ReferenceFieldResult = {
|
|
121
|
+
count: number;
|
|
122
|
+
action: 'connected' | 'disconnected' | 'unchanged';
|
|
123
|
+
};
|
|
124
|
+
type MemberReferenceFieldResult = {
|
|
125
|
+
count: number;
|
|
126
|
+
hasself: boolean;
|
|
127
|
+
action: 'connected' | 'disconnected' | 'unchanged';
|
|
128
|
+
};
|
|
121
129
|
type QueryDataRecordResponse = DataRecordResponse & {
|
|
122
130
|
[relationName: string]: any;
|
|
123
131
|
_count?: Record<string, number>;
|
|
@@ -132,4 +140,4 @@ type Response<T> = {
|
|
|
132
140
|
data: T;
|
|
133
141
|
};
|
|
134
142
|
|
|
135
|
-
export type { AddMemberCardPayload, AddPlanPayload, AppPayload, CancelPlanPayload, ConnectProviderPayload, CreateDataRecordPayload, CreatePostPayload, CreateThreadPayload, DeleteDataRecordPayload, DeleteMemberPayload, GetAppAndMemberPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetCurrentMemberPayload, GetDataRecordPayload, GetDataRecordsPayload, GetDataTablePayload, GetDataTablesPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberJSONPayload, GetMemberReceiptsPayload, GetPlanPayload, GetPlansPayload, GetPostsPayload, GetRestrictedUrlGroupsPayload, GetSecureContentPayload, GetThreadsPayload, GetTotalCheckoutAmountPayload, LaunchStripeCustomerPortalPayload, LoginMemberEmailPasswordPayload, LogoutMemberPayload, OpenStripeCustomerPortalPayload, PurchasePlansPayload, PurchasePlansWithCheckoutPayload, QueryDataRecordsPayload, RefreshMemberTokensPayload, RemovePlanPayload, ReplacePlanPayload, ResetMemberPassworPayload, SendMemberLoginPasswordlessEmailPayload, SendMemberResetPasswordEmailPayload, SendMemberVerificationEmailPayload, SetPasswordPayload, SignupMemberAuthProviderPayload, SignupMemberEmailPasswordPayload, UpdateDataRecordPayload, UpdateDefaultCardPayload, UpdateMemberAuthPayload, UpdateMemberPayload, UpdateMemberProfileImagePayload, UpdatePlanPaymentPayload, UpdatePostPayload, UpdateThreadPayload };
|
|
143
|
+
export type { AddMemberCardPayload, AddPlanPayload, AppPayload, CancelPlanPayload, ConnectProviderPayload, CreateDataRecordPayload, CreatePostPayload, CreateThreadPayload, DeleteDataRecordPayload, DeleteMemberPayload, GetAppAndMemberPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetCurrentMemberPayload, GetDataRecordPayload, GetDataRecordsPayload, GetDataTablePayload, GetDataTablesPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberJSONPayload, GetMemberReceiptsPayload, GetPlanPayload, GetPlansPayload, GetPostsPayload, GetRestrictedUrlGroupsPayload, GetSecureContentPayload, GetThreadsPayload, GetTotalCheckoutAmountPayload, LaunchStripeCustomerPortalPayload, LoginMemberEmailPasswordPayload, LogoutMemberPayload, MemberReferenceFieldResult, OpenStripeCustomerPortalPayload, PurchasePlansPayload, PurchasePlansWithCheckoutPayload, QueryDataRecordsPayload, ReferenceFieldResult, RefreshMemberTokensPayload, RemovePlanPayload, ReplacePlanPayload, ResetMemberPassworPayload, SendMemberLoginPasswordlessEmailPayload, SendMemberResetPasswordEmailPayload, SendMemberVerificationEmailPayload, SetPasswordPayload, SignupMemberAuthProviderPayload, SignupMemberEmailPasswordPayload, UpdateDataRecordPayload, UpdateDefaultCardPayload, UpdateMemberAuthPayload, UpdateMemberPayload, UpdateMemberProfileImagePayload, UpdatePlanPaymentPayload, UpdatePostPayload, UpdateThreadPayload };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberstack/dom",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./lib/index.mjs",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"dev": "tsup --format esm,cjs --dts --watch x--env.API_ENDPOINT https://client.memberstack.com",
|
|
19
19
|
"build": "tsup --format esm,cjs --dts --env.API_ENDPOINT https://client.memberstack.com",
|
|
20
|
-
"prepublishOnly": "yarn workspace prebuilt-uis build &&
|
|
20
|
+
"prepublishOnly": "yarn workspace prebuilt-uis build && tsup --format esm,cjs --dts --env.API_ENDPOINT https://client.memberstack.com",
|
|
21
21
|
"prepublishOnly:porter-prod": "yarn workspace prebuilt-uis build && tsup --format esm,cjs --dts --env.API_ENDPOINT https://client.memberstack.com",
|
|
22
22
|
"prepublishOnly:porter-dev": "yarn workspace prebuilt-uis build && tsup --format esm,cjs --dts --env.API_ENDPOINT https://dev-client.memberstack.com",
|
|
23
23
|
"watch": "tsc-watch",
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
"tsc-watch": "^6.0.4",
|
|
37
37
|
"tsup": "^7.2.0"
|
|
38
38
|
}
|
|
39
|
-
}
|
|
39
|
+
}
|