@parra/parra-js-sdk 0.3.121 → 0.3.123

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.
@@ -67,7 +67,7 @@ export interface TenantUserStub {
67
67
  deleted_at?: string | null;
68
68
  tenant_id: string;
69
69
  name?: string | null;
70
- avatar?: ImageAssetStub;
70
+ avatar?: ImageAssetStub | null;
71
71
  }
72
72
  export interface TenantUserCollectionStub {
73
73
  id: string;
@@ -76,7 +76,7 @@ export interface TenantUserCollectionStub {
76
76
  deleted_at?: string | null;
77
77
  tenant_id: string;
78
78
  name?: string | null;
79
- avatar?: ImageAssetStub;
79
+ avatar?: ImageAssetStub | null;
80
80
  identity?: string | null;
81
81
  username?: string | null;
82
82
  email?: string | null;
@@ -98,7 +98,7 @@ export interface TenantUserDataStub {
98
98
  deleted_at?: string | null;
99
99
  tenant_id: string;
100
100
  name?: string | null;
101
- avatar?: ImageAssetStub;
101
+ avatar?: ImageAssetStub | null;
102
102
  identity?: string | null;
103
103
  username?: string | null;
104
104
  email?: string | null;
@@ -120,7 +120,7 @@ export interface TenantUser {
120
120
  deleted_at?: string | null;
121
121
  tenant_id: string;
122
122
  name?: string | null;
123
- avatar?: ImageAssetStub;
123
+ avatar?: ImageAssetStub | null;
124
124
  identity?: string | null;
125
125
  username?: string | null;
126
126
  email?: string | null;
@@ -1834,6 +1834,7 @@ export interface CreateTenantUserRequestBody {
1834
1834
  name?: string | null;
1835
1835
  password?: string | null;
1836
1836
  properties?: object | null;
1837
+ subdomain?: string | null;
1837
1838
  username?: string | null;
1838
1839
  email?: string | null;
1839
1840
  email_verified?: boolean | null;
@@ -1860,8 +1861,86 @@ export interface UpdateTenantRequestBody {
1860
1861
  }
1861
1862
  export interface CreateTenantForUserRequestBody {
1862
1863
  name: string;
1864
+ subdomain?: string | null;
1863
1865
  is_test: boolean;
1864
1866
  }
1867
+ export declare enum PolicyDocumentType {
1868
+ terms = "terms",
1869
+ privacy = "privacy",
1870
+ cookie = "cookie"
1871
+ }
1872
+ export interface UpdatePolicyDocumentRequestBody {
1873
+ title?: string | null;
1874
+ }
1875
+ export interface CreatePolicyDocumentRequestBody {
1876
+ title?: string | null;
1877
+ type: PolicyDocumentType;
1878
+ self_hosted: boolean;
1879
+ url?: string | null;
1880
+ }
1881
+ export declare enum PolicyDocumentStatus {
1882
+ live = "live",
1883
+ draft = "draft",
1884
+ hosted = "hosted"
1885
+ }
1886
+ export declare enum PolicyDocumentVersionStatus {
1887
+ pristine = "pristine",
1888
+ draft = "draft",
1889
+ published = "published"
1890
+ }
1891
+ export interface PolicyDocumentVersionStub {
1892
+ id: string;
1893
+ created_at: string;
1894
+ updated_at: string;
1895
+ deleted_at?: string | null;
1896
+ version: string;
1897
+ title: string | null;
1898
+ tenant_id: string;
1899
+ policy_document_id: string;
1900
+ status: PolicyDocumentVersionStatus;
1901
+ }
1902
+ export interface PolicyDocumentVersion {
1903
+ id: string;
1904
+ created_at: string;
1905
+ updated_at: string;
1906
+ deleted_at?: string | null;
1907
+ version: string;
1908
+ title: string | null;
1909
+ tenant_id: string;
1910
+ policy_document_id: string;
1911
+ status: PolicyDocumentVersionStatus;
1912
+ content: string | null;
1913
+ }
1914
+ export interface PolicyDocument {
1915
+ id: string;
1916
+ created_at: string;
1917
+ updated_at: string;
1918
+ deleted_at?: string | null;
1919
+ tenant_id: string;
1920
+ type: PolicyDocumentType;
1921
+ title: string;
1922
+ status: PolicyDocumentStatus;
1923
+ published_version?: PolicyDocumentVersion | null;
1924
+ draft_version?: PolicyDocumentVersion | null;
1925
+ }
1926
+ export interface PolicyDocumentCollectionStub {
1927
+ id: string;
1928
+ created_at: string;
1929
+ updated_at: string;
1930
+ deleted_at?: string | null;
1931
+ type: PolicyDocumentType;
1932
+ status?: PolicyDocumentStatus;
1933
+ title: string | null;
1934
+ published_version?: string | null;
1935
+ url: string;
1936
+ }
1937
+ export interface PolicyDocumentCollectionResponse {
1938
+ page: number;
1939
+ page_count: number;
1940
+ page_size: number;
1941
+ total_count: number;
1942
+ data: Array<PolicyDocumentCollectionStub>;
1943
+ }
1865
1944
  export interface UpdateUserRequestBody {
1866
1945
  first_name: string;
1867
1946
  last_name: string;
@@ -2182,6 +2261,19 @@ declare class ParraAPI {
2182
2261
  createTenant: (body: CreateTenantRequestBody, options?: Options) => Promise<Tenant>;
2183
2262
  createTenantForUserById: (user_id: string, body: CreateTenantForUserRequestBody, options?: Options) => Promise<Tenant>;
2184
2263
  getTenantsForUserById: (user_id: string, options?: Options) => Promise<Array<Tenant>>;
2264
+ createPolicyDocumentForTenantById: (tenant_id: string, body: CreatePolicyDocumentRequestBody, options?: Options) => Promise<PolicyDocument>;
2265
+ paginatePolicyDocumentsForTenantById: (tenant_id: string, query?: {
2266
+ $select?: string;
2267
+ $top?: number;
2268
+ $skip?: number;
2269
+ $orderby?: string;
2270
+ $filter?: string;
2271
+ $expand?: string;
2272
+ $search?: string;
2273
+ }, options?: Options) => Promise<PolicyDocumentCollectionResponse>;
2274
+ getPolicyDocumentByIdForTenantById: (tenant_id: string, policy_document_id: string, options?: Options) => Promise<PolicyDocument>;
2275
+ updatePolicyDocumentByIdForTenantById: (tenant_id: string, policy_document_id: string, body?: UpdatePolicyDocumentRequestBody, options?: Options) => Promise<PolicyDocument>;
2276
+ deletePolicyDocumentByIdForTenantById: (tenant_id: string, policy_document_id: string, options?: Options) => Promise<Response>;
2185
2277
  getUserById: (user_id: string, options?: Options) => Promise<UserResponse>;
2186
2278
  updateUserById: (user_id: string, body: UpdateUserRequestBody, options?: Options) => Promise<UserResponse>;
2187
2279
  deleteUserById: (user_id: string, options?: Options) => Promise<Response>;
package/dist/ParraAPI.js CHANGED
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = exports.ConnectedAppType = exports.ApplicationType = exports.RefreshTokenRotationType = exports.RefreshTokenExpirationType = exports.JwtAlgorithm = exports.GrantType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.FeedbackFormFieldType = exports.SubscriptionStatus = exports.Currency = exports.Interval = exports.IdentityType = void 0;
14
+ exports.PolicyDocumentVersionStatus = exports.PolicyDocumentStatus = exports.PolicyDocumentType = exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = exports.ConnectedAppType = exports.ApplicationType = exports.RefreshTokenRotationType = exports.RefreshTokenExpirationType = exports.JwtAlgorithm = exports.GrantType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.FeedbackFormFieldType = exports.SubscriptionStatus = exports.Currency = exports.Interval = exports.IdentityType = void 0;
15
15
  var IdentityType;
16
16
  (function (IdentityType) {
17
17
  IdentityType["username"] = "username";
@@ -241,6 +241,24 @@ var IntegrationScope;
241
241
  IntegrationScope["collection"] = "collection";
242
242
  IntegrationScope["resource"] = "resource";
243
243
  })(IntegrationScope || (exports.IntegrationScope = IntegrationScope = {}));
244
+ var PolicyDocumentType;
245
+ (function (PolicyDocumentType) {
246
+ PolicyDocumentType["terms"] = "terms";
247
+ PolicyDocumentType["privacy"] = "privacy";
248
+ PolicyDocumentType["cookie"] = "cookie";
249
+ })(PolicyDocumentType || (exports.PolicyDocumentType = PolicyDocumentType = {}));
250
+ var PolicyDocumentStatus;
251
+ (function (PolicyDocumentStatus) {
252
+ PolicyDocumentStatus["live"] = "live";
253
+ PolicyDocumentStatus["draft"] = "draft";
254
+ PolicyDocumentStatus["hosted"] = "hosted";
255
+ })(PolicyDocumentStatus || (exports.PolicyDocumentStatus = PolicyDocumentStatus = {}));
256
+ var PolicyDocumentVersionStatus;
257
+ (function (PolicyDocumentVersionStatus) {
258
+ PolicyDocumentVersionStatus["pristine"] = "pristine";
259
+ PolicyDocumentVersionStatus["draft"] = "draft";
260
+ PolicyDocumentVersionStatus["published"] = "published";
261
+ })(PolicyDocumentVersionStatus || (exports.PolicyDocumentVersionStatus = PolicyDocumentVersionStatus = {}));
244
262
  var ParraAPI = /** @class */ (function () {
245
263
  function ParraAPI(http, options) {
246
264
  var _this = this;
@@ -935,6 +953,30 @@ var ParraAPI = /** @class */ (function () {
935
953
  if (options === void 0) { options = {}; }
936
954
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), __assign({ method: "get" }, options));
937
955
  };
956
+ this.createPolicyDocumentForTenantById = function (tenant_id, body, options) {
957
+ if (options === void 0) { options = {}; }
958
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/policy-documents"), __assign({ method: "post", body: JSON.stringify(body), headers: {
959
+ "content-type": "application/json",
960
+ } }, options));
961
+ };
962
+ this.paginatePolicyDocumentsForTenantById = function (tenant_id, query, options) {
963
+ if (options === void 0) { options = {}; }
964
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/policy-documents"), __assign({ method: "get", query: query }, options));
965
+ };
966
+ this.getPolicyDocumentByIdForTenantById = function (tenant_id, policy_document_id, options) {
967
+ if (options === void 0) { options = {}; }
968
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/policy-documents/").concat(policy_document_id), __assign({ method: "get" }, options));
969
+ };
970
+ this.updatePolicyDocumentByIdForTenantById = function (tenant_id, policy_document_id, body, options) {
971
+ if (options === void 0) { options = {}; }
972
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/policy-documents/").concat(policy_document_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
973
+ "content-type": "application/json",
974
+ } }, options));
975
+ };
976
+ this.deletePolicyDocumentByIdForTenantById = function (tenant_id, policy_document_id, options) {
977
+ if (options === void 0) { options = {}; }
978
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/policy-documents/").concat(policy_document_id), __assign({ method: "delete" }, options));
979
+ };
938
980
  this.getUserById = function (user_id, options) {
939
981
  if (options === void 0) { options = {}; }
940
982
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id), __assign({ method: "get" }, options));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.121",
3
+ "version": "0.3.123",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",