@parra/parra-js-sdk 0.2.67 → 0.2.71
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/ParraAPI.d.ts +32 -6
- package/dist/ParraAPI.js +38 -0
- package/package.json +1 -1
package/dist/ParraAPI.d.ts
CHANGED
|
@@ -114,13 +114,27 @@ export interface Audience {
|
|
|
114
114
|
export interface CreateSubscriberRequestBody {
|
|
115
115
|
email: string;
|
|
116
116
|
}
|
|
117
|
+
export interface AuthToken {
|
|
118
|
+
access_token: string;
|
|
119
|
+
}
|
|
120
|
+
export interface CreateAuthTokenRequestBody {
|
|
121
|
+
user_id: string;
|
|
122
|
+
}
|
|
117
123
|
export interface Entitlement {
|
|
118
124
|
}
|
|
119
125
|
export declare type Entitlements = Array<Entitlement>;
|
|
120
126
|
export declare type UpdateEntitlementsRequestBody = Array<Entitlement>;
|
|
127
|
+
export interface UpdateTenantRequestBody {
|
|
128
|
+
name: string;
|
|
129
|
+
}
|
|
121
130
|
export interface CreateTenantRequestBody {
|
|
122
131
|
name: string;
|
|
123
132
|
is_test: boolean;
|
|
133
|
+
parent_tenant_id?: string | null;
|
|
134
|
+
}
|
|
135
|
+
export interface CreateTenantForUserRequestBody {
|
|
136
|
+
name: string;
|
|
137
|
+
is_test: boolean;
|
|
124
138
|
}
|
|
125
139
|
export interface TenantUser {
|
|
126
140
|
id: string;
|
|
@@ -129,6 +143,7 @@ export interface TenantUser {
|
|
|
129
143
|
deleted_at?: string | null;
|
|
130
144
|
name: string;
|
|
131
145
|
is_test: boolean;
|
|
146
|
+
parent_tenant_id?: string | null;
|
|
132
147
|
entitlements?: Array<Entitlement> | null;
|
|
133
148
|
scopes: Array<string>;
|
|
134
149
|
}
|
|
@@ -139,6 +154,7 @@ export interface Tenant {
|
|
|
139
154
|
deleted_at?: string | null;
|
|
140
155
|
name: string;
|
|
141
156
|
is_test: boolean;
|
|
157
|
+
parent_tenant_id?: string | null;
|
|
142
158
|
entitlements?: Array<Entitlement> | null;
|
|
143
159
|
}
|
|
144
160
|
export declare type TenantListResponse = Array<Tenant>;
|
|
@@ -151,10 +167,12 @@ export interface TenantCollectionResponse {
|
|
|
151
167
|
}
|
|
152
168
|
export interface TenantMetrics {
|
|
153
169
|
team_member_count: number;
|
|
170
|
+
child_tenant_count: number;
|
|
154
171
|
}
|
|
155
172
|
export interface CreateApiKeyRequestBody {
|
|
156
173
|
name: string;
|
|
157
174
|
description?: string | null;
|
|
175
|
+
is_public: boolean;
|
|
158
176
|
}
|
|
159
177
|
export interface ApiKey {
|
|
160
178
|
id: string;
|
|
@@ -163,6 +181,7 @@ export interface ApiKey {
|
|
|
163
181
|
deleted_at?: string | null;
|
|
164
182
|
name: string;
|
|
165
183
|
description?: string | null;
|
|
184
|
+
is_public: boolean;
|
|
166
185
|
tenant_id: string;
|
|
167
186
|
}
|
|
168
187
|
export interface ApiKeyWithSecretResponse {
|
|
@@ -172,8 +191,9 @@ export interface ApiKeyWithSecretResponse {
|
|
|
172
191
|
deleted_at?: string | null;
|
|
173
192
|
name: string;
|
|
174
193
|
description?: string | null;
|
|
194
|
+
is_public: boolean;
|
|
175
195
|
tenant_id: string;
|
|
176
|
-
secret
|
|
196
|
+
secret?: string | null;
|
|
177
197
|
}
|
|
178
198
|
export interface ApiKeyCollectionResponse {
|
|
179
199
|
page: number;
|
|
@@ -195,7 +215,7 @@ export interface TenantInvitation {
|
|
|
195
215
|
member_id?: string | null;
|
|
196
216
|
name: string;
|
|
197
217
|
email: string;
|
|
198
|
-
code
|
|
218
|
+
code?: string;
|
|
199
219
|
expires_at?: string;
|
|
200
220
|
accepted_at?: string | null;
|
|
201
221
|
}
|
|
@@ -214,6 +234,10 @@ export interface TeamMember {
|
|
|
214
234
|
export declare type TeamMemberListResponse = Array<TeamMember>;
|
|
215
235
|
export interface AnswerData {
|
|
216
236
|
}
|
|
237
|
+
export interface FormResponse {
|
|
238
|
+
}
|
|
239
|
+
export interface Form {
|
|
240
|
+
}
|
|
217
241
|
export interface FeedbackMetrics {
|
|
218
242
|
questions_created_this_month: number;
|
|
219
243
|
}
|
|
@@ -452,9 +476,6 @@ export interface UserCollectionResponse {
|
|
|
452
476
|
export interface CheckAuthorizationRequestBody {
|
|
453
477
|
scope: string;
|
|
454
478
|
}
|
|
455
|
-
export interface AuthToken {
|
|
456
|
-
access_token: string;
|
|
457
|
-
}
|
|
458
479
|
export interface CheckAuthorization {
|
|
459
480
|
allowed: boolean;
|
|
460
481
|
}
|
|
@@ -474,8 +495,11 @@ declare class ParraAPI {
|
|
|
474
495
|
getPlansForTenantById: (tenant_id: string) => Promise<TenantPlansResponse>;
|
|
475
496
|
createAudience: (body?: CreateAudienceRequestBody | undefined) => Promise<Audience>;
|
|
476
497
|
createSubscriberForAudienceById: (audience_id: string, body?: CreateSubscriberRequestBody | undefined) => Promise<Response>;
|
|
498
|
+
createTenant: (body?: CreateTenantRequestBody | undefined) => Promise<Tenant>;
|
|
477
499
|
getTenantById: (tenant_id: string) => Promise<Tenant>;
|
|
478
|
-
|
|
500
|
+
updateTenantById: (tenant_id: string, body?: UpdateTenantRequestBody | undefined) => Promise<Tenant>;
|
|
501
|
+
deleteTenantById: (tenant_id: string) => Promise<Response>;
|
|
502
|
+
createTenantForUserById: (user_id: string, body?: CreateTenantForUserRequestBody | undefined) => Promise<Tenant>;
|
|
479
503
|
getTenantsForUserById: (user_id: string) => Promise<TenantListResponse>;
|
|
480
504
|
createApiKeyForTenantById: (tenant_id: string, body?: CreateApiKeyRequestBody | undefined) => Promise<ApiKeyWithSecretResponse>;
|
|
481
505
|
getApiKeysForTenantById: (tenant_id: string) => Promise<ApiKeyCollectionResponse>;
|
|
@@ -488,6 +512,8 @@ declare class ParraAPI {
|
|
|
488
512
|
deleteTeamMemberForTenantById: (tenant_id: string, team_member_id: string) => Promise<Response>;
|
|
489
513
|
updateTeamMemberUserForTenantById: (tenant_id: string, team_member_id: string) => Promise<Response>;
|
|
490
514
|
getCards: () => Promise<CardsResponse>;
|
|
515
|
+
getFormById: (form_id: string) => Promise<Form>;
|
|
516
|
+
submitFormById: (form_id: string, body?: FormResponse | undefined) => Promise<Response>;
|
|
491
517
|
createQuestion: (body?: CreateQuestionRequestBody | undefined) => Promise<Question>;
|
|
492
518
|
paginateQuestions: (query?: {
|
|
493
519
|
$select?: string | undefined;
|
package/dist/ParraAPI.js
CHANGED
|
@@ -97,11 +97,34 @@ var ParraAPI = /** @class */ (function () {
|
|
|
97
97
|
raw: true,
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
|
+
this.createTenant = function (body) {
|
|
101
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants"), {
|
|
102
|
+
method: "post",
|
|
103
|
+
body: JSON.stringify(body),
|
|
104
|
+
headers: {
|
|
105
|
+
"content-type": "application/json",
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
};
|
|
100
109
|
this.getTenantById = function (tenant_id) {
|
|
101
110
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
|
|
102
111
|
method: "get",
|
|
103
112
|
});
|
|
104
113
|
};
|
|
114
|
+
this.updateTenantById = function (tenant_id, body) {
|
|
115
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
|
|
116
|
+
method: "put",
|
|
117
|
+
body: JSON.stringify(body),
|
|
118
|
+
headers: {
|
|
119
|
+
"content-type": "application/json",
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
this.deleteTenantById = function (tenant_id) {
|
|
124
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
|
|
125
|
+
method: "delete",
|
|
126
|
+
});
|
|
127
|
+
};
|
|
105
128
|
this.createTenantForUserById = function (user_id, body) {
|
|
106
129
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), {
|
|
107
130
|
method: "post",
|
|
@@ -179,6 +202,21 @@ var ParraAPI = /** @class */ (function () {
|
|
|
179
202
|
method: "get",
|
|
180
203
|
});
|
|
181
204
|
};
|
|
205
|
+
this.getFormById = function (form_id) {
|
|
206
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/forms/").concat(form_id), {
|
|
207
|
+
method: "get",
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
this.submitFormById = function (form_id, body) {
|
|
211
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/forms/").concat(form_id, "/submit"), {
|
|
212
|
+
method: "post",
|
|
213
|
+
body: JSON.stringify(body),
|
|
214
|
+
headers: {
|
|
215
|
+
"content-type": "application/json",
|
|
216
|
+
},
|
|
217
|
+
raw: true,
|
|
218
|
+
});
|
|
219
|
+
};
|
|
182
220
|
this.createQuestion = function (body) {
|
|
183
221
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions"), {
|
|
184
222
|
method: "post",
|