shred-api-client 2.4.4 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -582,7 +582,7 @@ interface IAPI$9 {
|
|
|
582
582
|
pause: (ctx: Context) => Promise<boolean>;
|
|
583
583
|
resume: (ctx: Context) => Promise<boolean>;
|
|
584
584
|
updatePlan: (ctx: Context, planId: string) => Promise<boolean>;
|
|
585
|
-
createCheckout: (planId: string | null, ctx: Context) => Promise<string>;
|
|
585
|
+
createCheckout: (planId: string | null, ctx: Context, callbackUrl?: string) => Promise<string>;
|
|
586
586
|
getSubscriptionsSummary: (ctx: Context) => Promise<SubscriptionSummary[]>;
|
|
587
587
|
}
|
|
588
588
|
declare const Endpoints$8: {
|
|
@@ -1918,6 +1918,7 @@ interface IAPI$4 {
|
|
|
1918
1918
|
start: (context: Context) => Promise<boolean>;
|
|
1919
1919
|
sendToApproval: (context: Context, projectId: string, data: SendToApproval) => Promise<boolean>;
|
|
1920
1920
|
approve: (context: Context, projectId: string, data: Approve) => Promise<boolean>;
|
|
1921
|
+
assign: (context: Context, editorId: string, projectId: string) => Promise<boolean>;
|
|
1921
1922
|
deny: (context: Context, projectId: string, denyFeedback: string, categories?: string[]) => Promise<boolean>;
|
|
1922
1923
|
unschedule: (context: Context, projectId: string) => Promise<boolean>;
|
|
1923
1924
|
rollback: (context: Context, projectId: string) => Promise<boolean>;
|
|
@@ -1989,6 +1990,10 @@ declare const Endpoints$3: {
|
|
|
1989
1990
|
uri: string;
|
|
1990
1991
|
method: string;
|
|
1991
1992
|
};
|
|
1993
|
+
Assign: {
|
|
1994
|
+
uri: string;
|
|
1995
|
+
method: string;
|
|
1996
|
+
};
|
|
1992
1997
|
GetUserHistory: {
|
|
1993
1998
|
uri: string;
|
|
1994
1999
|
method: string;
|
package/dist/index.js
CHANGED
|
@@ -4600,13 +4600,13 @@ var SubscriptionAPI = class {
|
|
|
4600
4600
|
);
|
|
4601
4601
|
return data;
|
|
4602
4602
|
}
|
|
4603
|
-
async createCheckout(planId, ctx) {
|
|
4603
|
+
async createCheckout(planId, ctx, callbackUrl) {
|
|
4604
4604
|
const endpointInfo = subscription_exports.Endpoints.Checkout;
|
|
4605
4605
|
const data = await this.clientHTTP.makeRequest(
|
|
4606
4606
|
this.env,
|
|
4607
4607
|
endpointInfo.uri,
|
|
4608
4608
|
endpointInfo.method,
|
|
4609
|
-
{ planId },
|
|
4609
|
+
{ planId, callbackUrl },
|
|
4610
4610
|
ctx
|
|
4611
4611
|
);
|
|
4612
4612
|
return data.url;
|
|
@@ -5078,6 +5078,7 @@ var Endpoints3 = {
|
|
|
5078
5078
|
Unschedule: { uri: "/projects/:projectId/unschedule/", method: "POST" },
|
|
5079
5079
|
Rollback: { uri: "/projects/:projectId/rollback/", method: "POST" },
|
|
5080
5080
|
Deny: { uri: "/projects/:projectId/deny/", method: "POST" },
|
|
5081
|
+
Assign: { uri: "/projects/:projectId/assign/", method: "POST" },
|
|
5081
5082
|
GetUserHistory: { uri: "/projects/user/:userId/history/", method: "GET" },
|
|
5082
5083
|
GetPoolSize: { uri: "/projects/pool/size/", method: "GET" }
|
|
5083
5084
|
};
|
|
@@ -5321,6 +5322,18 @@ var ProjectAPI = class {
|
|
|
5321
5322
|
this.env = env;
|
|
5322
5323
|
this.clientHTTP = new HTTPClient();
|
|
5323
5324
|
}
|
|
5325
|
+
async assign(ctx, editorId, pId) {
|
|
5326
|
+
const endpointData = Endpoints3.Assign;
|
|
5327
|
+
const endpoint = endpointData.uri.replace(":projectId", pId);
|
|
5328
|
+
const data = await this.clientHTTP.makeRequest(
|
|
5329
|
+
this.env,
|
|
5330
|
+
endpoint,
|
|
5331
|
+
endpointData.method,
|
|
5332
|
+
{ editor: editorId },
|
|
5333
|
+
ctx
|
|
5334
|
+
);
|
|
5335
|
+
return data.success;
|
|
5336
|
+
}
|
|
5324
5337
|
async getPoolSize(context) {
|
|
5325
5338
|
const endpointData = Endpoints3.GetPoolSize;
|
|
5326
5339
|
const data = await this.clientHTTP.makeRequest(
|