@commercelayer/provisioning-sdk 1.0.0-beta.1
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/LICENSE +21 -0
- package/README.md +415 -0
- package/lib/cjs/api.d.ts +41 -0
- package/lib/cjs/api.js +37 -0
- package/lib/cjs/client.d.ts +39 -0
- package/lib/cjs/client.js +121 -0
- package/lib/cjs/commercelayer.d.ts +36 -0
- package/lib/cjs/commercelayer.js +126 -0
- package/lib/cjs/common.d.ts +5 -0
- package/lib/cjs/common.js +12 -0
- package/lib/cjs/config.d.ts +12 -0
- package/lib/cjs/config.js +16 -0
- package/lib/cjs/debug.d.ts +3 -0
- package/lib/cjs/debug.js +38 -0
- package/lib/cjs/error.d.ts +31 -0
- package/lib/cjs/error.js +77 -0
- package/lib/cjs/index.d.ts +7 -0
- package/lib/cjs/index.js +13 -0
- package/lib/cjs/interceptor.d.ts +25 -0
- package/lib/cjs/interceptor.js +2 -0
- package/lib/cjs/jsonapi.d.ts +5 -0
- package/lib/cjs/jsonapi.js +89 -0
- package/lib/cjs/model.d.ts +10 -0
- package/lib/cjs/model.js +3 -0
- package/lib/cjs/query.d.ts +17 -0
- package/lib/cjs/query.js +52 -0
- package/lib/cjs/resource.d.ts +86 -0
- package/lib/cjs/resource.js +191 -0
- package/lib/cjs/resources/api_credentials.d.ts +55 -0
- package/lib/cjs/resources/api_credentials.js +33 -0
- package/lib/cjs/resources/memberships.d.ts +46 -0
- package/lib/cjs/resources/memberships.js +37 -0
- package/lib/cjs/resources/organizations.d.ts +78 -0
- package/lib/cjs/resources/organizations.js +34 -0
- package/lib/cjs/resources/permissions.d.ts +52 -0
- package/lib/cjs/resources/permissions.js +34 -0
- package/lib/cjs/resources/roles.d.ts +47 -0
- package/lib/cjs/resources/roles.js +42 -0
- package/lib/cjs/resources/user.d.ts +29 -0
- package/lib/cjs/resources/user.js +19 -0
- package/lib/cjs/resources/versions.d.ts +22 -0
- package/lib/cjs/resources/versions.js +16 -0
- package/lib/cjs/static.d.ts +9 -0
- package/lib/cjs/static.js +45 -0
- package/lib/cjs/util.d.ts +9 -0
- package/lib/cjs/util.js +15 -0
- package/lib/esm/api.d.ts +41 -0
- package/lib/esm/api.js +24 -0
- package/lib/esm/client.d.ts +39 -0
- package/lib/esm/client.js +116 -0
- package/lib/esm/commercelayer.d.ts +36 -0
- package/lib/esm/commercelayer.js +97 -0
- package/lib/esm/common.d.ts +5 -0
- package/lib/esm/common.js +8 -0
- package/lib/esm/config.d.ts +12 -0
- package/lib/esm/config.js +14 -0
- package/lib/esm/debug.d.ts +3 -0
- package/lib/esm/debug.js +36 -0
- package/lib/esm/error.d.ts +31 -0
- package/lib/esm/error.js +69 -0
- package/lib/esm/index.d.ts +7 -0
- package/lib/esm/index.js +4 -0
- package/lib/esm/interceptor.d.ts +25 -0
- package/lib/esm/interceptor.js +1 -0
- package/lib/esm/jsonapi.d.ts +5 -0
- package/lib/esm/jsonapi.js +82 -0
- package/lib/esm/model.d.ts +10 -0
- package/lib/esm/model.js +2 -0
- package/lib/esm/query.d.ts +17 -0
- package/lib/esm/query.js +45 -0
- package/lib/esm/resource.d.ts +86 -0
- package/lib/esm/resource.js +184 -0
- package/lib/esm/resources/api_credentials.d.ts +55 -0
- package/lib/esm/resources/api_credentials.js +31 -0
- package/lib/esm/resources/memberships.d.ts +46 -0
- package/lib/esm/resources/memberships.js +35 -0
- package/lib/esm/resources/organizations.d.ts +78 -0
- package/lib/esm/resources/organizations.js +32 -0
- package/lib/esm/resources/permissions.d.ts +52 -0
- package/lib/esm/resources/permissions.js +32 -0
- package/lib/esm/resources/roles.d.ts +47 -0
- package/lib/esm/resources/roles.js +40 -0
- package/lib/esm/resources/user.d.ts +29 -0
- package/lib/esm/resources/user.js +17 -0
- package/lib/esm/resources/versions.d.ts +22 -0
- package/lib/esm/resources/versions.js +14 -0
- package/lib/esm/static.d.ts +9 -0
- package/lib/esm/static.js +19 -0
- package/lib/esm/util.d.ts +9 -0
- package/lib/esm/util.js +11 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type ApiClientInitConfig } from './client';
|
|
2
|
+
import type { QueryParamsRetrieve, QueryParamsList, QueryFilter, QueryParams } from './query';
|
|
3
|
+
import type { ResourceTypeLock } from './api';
|
|
4
|
+
import type { InterceptorManager } from './interceptor';
|
|
5
|
+
type ResourceNull = {
|
|
6
|
+
id: null;
|
|
7
|
+
} & ResourceType;
|
|
8
|
+
type ResourceRel = ResourceId | ResourceNull;
|
|
9
|
+
type Metadata = Record<string, any>;
|
|
10
|
+
interface ResourceType {
|
|
11
|
+
readonly type: ResourceTypeLock;
|
|
12
|
+
}
|
|
13
|
+
interface ResourceId extends ResourceType {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
}
|
|
16
|
+
interface ResourceBase {
|
|
17
|
+
reference?: string | null;
|
|
18
|
+
reference_origin?: string | null;
|
|
19
|
+
metadata?: Metadata;
|
|
20
|
+
}
|
|
21
|
+
interface Resource extends ResourceBase, ResourceId {
|
|
22
|
+
readonly created_at: string;
|
|
23
|
+
readonly updated_at: string;
|
|
24
|
+
}
|
|
25
|
+
interface ResourceCreate extends ResourceBase {
|
|
26
|
+
}
|
|
27
|
+
interface ResourceUpdate extends ResourceBase {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
}
|
|
30
|
+
type ListMeta = {
|
|
31
|
+
readonly pageCount: number;
|
|
32
|
+
readonly recordCount: number;
|
|
33
|
+
readonly currentPage: number;
|
|
34
|
+
readonly recordsPerPage: number;
|
|
35
|
+
};
|
|
36
|
+
declare class ListResponse<R> extends Array<R> {
|
|
37
|
+
readonly meta: ListMeta;
|
|
38
|
+
constructor(meta: ListMeta, data: R[]);
|
|
39
|
+
first(): R | undefined;
|
|
40
|
+
last(): R | undefined;
|
|
41
|
+
get(index: number): R | undefined;
|
|
42
|
+
hasNextPage(): boolean;
|
|
43
|
+
hasPrevPage(): boolean;
|
|
44
|
+
getRecordCount(): number;
|
|
45
|
+
getPageCount(): number;
|
|
46
|
+
get recordCount(): number;
|
|
47
|
+
get pageCount(): number;
|
|
48
|
+
}
|
|
49
|
+
export type { Metadata, ResourceType, ResourceId, Resource, ResourceCreate, ResourceUpdate, ListResponse, ListMeta, ResourceRel };
|
|
50
|
+
type ResourceAdapterConfig = {};
|
|
51
|
+
type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
|
|
52
|
+
type ResourcesConfig = Partial<ResourcesInitConfig>;
|
|
53
|
+
declare class ResourceAdapter {
|
|
54
|
+
#private;
|
|
55
|
+
constructor(config: ResourcesInitConfig);
|
|
56
|
+
get interceptors(): InterceptorManager;
|
|
57
|
+
private localConfig;
|
|
58
|
+
config(config: ResourcesConfig): ResourceAdapter;
|
|
59
|
+
singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
|
60
|
+
retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
|
61
|
+
list<R extends Resource>(resource: ResourceType, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
62
|
+
create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
|
63
|
+
update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
|
64
|
+
delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
65
|
+
fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams, options?: ResourcesConfig): Promise<R | ListResponse<R>>;
|
|
66
|
+
}
|
|
67
|
+
declare abstract class ApiResourceBase<R extends Resource> {
|
|
68
|
+
static readonly TYPE: ResourceTypeLock;
|
|
69
|
+
protected readonly resources: ResourceAdapter;
|
|
70
|
+
constructor(adapter: ResourceAdapter);
|
|
71
|
+
abstract relationship(id: string | ResourceId | null): ResourceRel;
|
|
72
|
+
abstract type(): ResourceTypeLock;
|
|
73
|
+
parse(resource: any): R | R[];
|
|
74
|
+
update(resource: ResourceUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
|
75
|
+
}
|
|
76
|
+
declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
|
|
77
|
+
retrieve(id: string | ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
|
78
|
+
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
79
|
+
count(filter?: QueryFilter | QueryParamsList, options?: ResourcesConfig): Promise<number>;
|
|
80
|
+
}
|
|
81
|
+
declare abstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {
|
|
82
|
+
retrieve(params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
|
83
|
+
}
|
|
84
|
+
export default ResourceAdapter;
|
|
85
|
+
export { ApiResource, ApiSingleton };
|
|
86
|
+
export type { ResourcesConfig, ResourcesInitConfig };
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
var _ResourceAdapter_client, _ResourceAdapter_config;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ApiSingleton = exports.ApiResource = void 0;
|
|
19
|
+
const client_1 = __importDefault(require("./client"));
|
|
20
|
+
const jsonapi_1 = require("./jsonapi");
|
|
21
|
+
const query_1 = require("./query");
|
|
22
|
+
const config_1 = __importDefault(require("./config"));
|
|
23
|
+
const debug_1 = __importDefault(require("./debug"));
|
|
24
|
+
const error_1 = require("./error");
|
|
25
|
+
const debug = (0, debug_1.default)('resource');
|
|
26
|
+
class ListResponse extends Array {
|
|
27
|
+
constructor(meta, data) {
|
|
28
|
+
super(...(data || []));
|
|
29
|
+
this.meta = meta;
|
|
30
|
+
}
|
|
31
|
+
first() { return this.length ? this[0] : undefined; }
|
|
32
|
+
last() { return this.length ? this[this.length - 1] : undefined; }
|
|
33
|
+
get(index) { return (this.length && (index >= 0)) ? this[index] : undefined; }
|
|
34
|
+
hasNextPage() { return (this.meta.currentPage < this.meta.pageCount); }
|
|
35
|
+
hasPrevPage() { return (this.meta.currentPage > 1); }
|
|
36
|
+
getRecordCount() { return this.meta.recordCount; }
|
|
37
|
+
getPageCount() { return this.meta.pageCount; }
|
|
38
|
+
get recordCount() { return this.meta.recordCount; }
|
|
39
|
+
get pageCount() { return this.meta.pageCount; }
|
|
40
|
+
}
|
|
41
|
+
class ResourceAdapter {
|
|
42
|
+
constructor(config) {
|
|
43
|
+
_ResourceAdapter_client.set(this, void 0);
|
|
44
|
+
_ResourceAdapter_config.set(this, {});
|
|
45
|
+
__classPrivateFieldSet(this, _ResourceAdapter_client, client_1.default.create(config), "f");
|
|
46
|
+
this.localConfig(config);
|
|
47
|
+
}
|
|
48
|
+
get interceptors() { return __classPrivateFieldGet(this, _ResourceAdapter_client, "f").interceptors; }
|
|
49
|
+
localConfig(config) {
|
|
50
|
+
// if (typeof config.xyz !== 'undefined') this.#config.xyz = config.xyz
|
|
51
|
+
}
|
|
52
|
+
config(config) {
|
|
53
|
+
debug('config %o', config);
|
|
54
|
+
// ResourceAdapter config
|
|
55
|
+
this.localConfig(config);
|
|
56
|
+
// Client config
|
|
57
|
+
__classPrivateFieldGet(this, _ResourceAdapter_client, "f").config(config);
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
/*
|
|
61
|
+
get clientInstance(): ApiClient {
|
|
62
|
+
return this.#client
|
|
63
|
+
}
|
|
64
|
+
*/
|
|
65
|
+
async singleton(resource, params, options) {
|
|
66
|
+
debug('singleton: %o, %O, %O', resource, params || {}, options || {});
|
|
67
|
+
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
|
68
|
+
if (options === null || options === void 0 ? void 0 : options.params)
|
|
69
|
+
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
|
70
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
|
|
71
|
+
const r = (0, jsonapi_1.denormalize)(res);
|
|
72
|
+
return r;
|
|
73
|
+
}
|
|
74
|
+
async retrieve(resource, params, options) {
|
|
75
|
+
debug('retrieve: %o, %O, %O', resource, params || {}, options || {});
|
|
76
|
+
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
|
77
|
+
if (options === null || options === void 0 ? void 0 : options.params)
|
|
78
|
+
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
|
79
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams });
|
|
80
|
+
const r = (0, jsonapi_1.denormalize)(res);
|
|
81
|
+
return r;
|
|
82
|
+
}
|
|
83
|
+
async list(resource, params, options) {
|
|
84
|
+
var _a, _b;
|
|
85
|
+
debug('list: %o, %O, %O', resource, params || {}, options || {});
|
|
86
|
+
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
|
87
|
+
if (options === null || options === void 0 ? void 0 : options.params)
|
|
88
|
+
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
|
89
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
|
|
90
|
+
const r = (0, jsonapi_1.denormalize)(res);
|
|
91
|
+
const meta = {
|
|
92
|
+
pageCount: Number((_a = res.meta) === null || _a === void 0 ? void 0 : _a.page_count),
|
|
93
|
+
recordCount: Number((_b = res.meta) === null || _b === void 0 ? void 0 : _b.record_count),
|
|
94
|
+
currentPage: (params === null || params === void 0 ? void 0 : params.pageNumber) || config_1.default.default.pageNumber,
|
|
95
|
+
recordsPerPage: (params === null || params === void 0 ? void 0 : params.pageSize) || config_1.default.default.pageSize
|
|
96
|
+
};
|
|
97
|
+
return new ListResponse(meta, r);
|
|
98
|
+
}
|
|
99
|
+
async create(resource, params, options) {
|
|
100
|
+
debug('create: %o, %O, %O', resource, params || {}, options || {});
|
|
101
|
+
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
|
102
|
+
if (options === null || options === void 0 ? void 0 : options.params)
|
|
103
|
+
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
|
104
|
+
const data = (0, jsonapi_1.normalize)(resource);
|
|
105
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('post', resource.type, data, { ...options, params: queryParams });
|
|
106
|
+
const r = (0, jsonapi_1.denormalize)(res);
|
|
107
|
+
return r;
|
|
108
|
+
}
|
|
109
|
+
async update(resource, params, options) {
|
|
110
|
+
debug('update: %o, %O, %O', resource, params || {}, options || {});
|
|
111
|
+
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
|
112
|
+
if (options === null || options === void 0 ? void 0 : options.params)
|
|
113
|
+
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
|
114
|
+
const data = (0, jsonapi_1.normalize)(resource);
|
|
115
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('patch', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams });
|
|
116
|
+
const r = (0, jsonapi_1.denormalize)(res);
|
|
117
|
+
return r;
|
|
118
|
+
}
|
|
119
|
+
async delete(resource, options) {
|
|
120
|
+
debug('delete: %o, %O', resource, options || {});
|
|
121
|
+
await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('delete', `${resource.type}/${resource.id}`, undefined, options);
|
|
122
|
+
}
|
|
123
|
+
async fetch(resource, path, params, options) {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
debug('fetch: %o, %O, %O', path, params || {}, options || {});
|
|
126
|
+
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
|
127
|
+
if (options === null || options === void 0 ? void 0 : options.params)
|
|
128
|
+
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
|
129
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', path, undefined, { ...options, params: queryParams });
|
|
130
|
+
const r = (0, jsonapi_1.denormalize)(res);
|
|
131
|
+
if (Array.isArray(r)) {
|
|
132
|
+
const p = params;
|
|
133
|
+
const meta = {
|
|
134
|
+
pageCount: Number((_a = res.meta) === null || _a === void 0 ? void 0 : _a.page_count),
|
|
135
|
+
recordCount: Number((_b = res.meta) === null || _b === void 0 ? void 0 : _b.record_count),
|
|
136
|
+
currentPage: (p === null || p === void 0 ? void 0 : p.pageNumber) || config_1.default.default.pageNumber,
|
|
137
|
+
recordsPerPage: (p === null || p === void 0 ? void 0 : p.pageSize) || config_1.default.default.pageSize
|
|
138
|
+
};
|
|
139
|
+
return new ListResponse(meta, r);
|
|
140
|
+
}
|
|
141
|
+
else
|
|
142
|
+
return r;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
_ResourceAdapter_client = new WeakMap(), _ResourceAdapter_config = new WeakMap();
|
|
146
|
+
class ApiResourceBase {
|
|
147
|
+
constructor(adapter) {
|
|
148
|
+
debug('new resource instance: %s', this.type());
|
|
149
|
+
this.resources = adapter;
|
|
150
|
+
}
|
|
151
|
+
parse(resource) {
|
|
152
|
+
var _a, _b;
|
|
153
|
+
try {
|
|
154
|
+
const res = JSON.parse(resource);
|
|
155
|
+
if (((_a = res.data) === null || _a === void 0 ? void 0 : _a.type) !== this.type())
|
|
156
|
+
throw new error_1.SdkError({ message: `Invalid resource type [${(_b = res.data) === null || _b === void 0 ? void 0 : _b.type}]`, type: error_1.ErrorType.PARSE });
|
|
157
|
+
return (0, jsonapi_1.denormalize)(res);
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
if (error_1.SdkError.isSdkError(error))
|
|
161
|
+
throw error;
|
|
162
|
+
else
|
|
163
|
+
throw new error_1.SdkError({ message: `Payload parse error [${error.message}]`, type: error_1.ErrorType.PARSE });
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// reference, reference_origin and metadata attributes are always updatable
|
|
167
|
+
async update(resource, params, options) {
|
|
168
|
+
return this.resources.update({ ...resource, type: this.type() }, params, options);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
class ApiResource extends ApiResourceBase {
|
|
172
|
+
async retrieve(id, params, options) {
|
|
173
|
+
return this.resources.retrieve((typeof id === 'string') ? { type: this.type(), id } : id, params, options);
|
|
174
|
+
}
|
|
175
|
+
async list(params, options) {
|
|
176
|
+
return this.resources.list({ type: this.type() }, params, options);
|
|
177
|
+
}
|
|
178
|
+
async count(filter, options) {
|
|
179
|
+
const params = { filters: (0, query_1.isParamsList)(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 };
|
|
180
|
+
const response = await this.list(params, options);
|
|
181
|
+
return Promise.resolve(response.meta.recordCount);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.ApiResource = ApiResource;
|
|
185
|
+
class ApiSingleton extends ApiResourceBase {
|
|
186
|
+
async retrieve(params, options) {
|
|
187
|
+
return this.resources.singleton({ type: this.type() }, params, options);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
exports.ApiSingleton = ApiSingleton;
|
|
191
|
+
exports.default = ResourceAdapter;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ApiResource } from '../resource';
|
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
|
3
|
+
import type { QueryParamsRetrieve } from '../query';
|
|
4
|
+
import type { Organization, OrganizationType } from './organizations';
|
|
5
|
+
import type { Role, RoleType } from './roles';
|
|
6
|
+
type ApiCredentialType = 'api_credentials';
|
|
7
|
+
type ApiCredentialRel = ResourceRel & {
|
|
8
|
+
type: ApiCredentialType;
|
|
9
|
+
};
|
|
10
|
+
type OrganizationRel = ResourceRel & {
|
|
11
|
+
type: OrganizationType;
|
|
12
|
+
};
|
|
13
|
+
type RoleRel = ResourceRel & {
|
|
14
|
+
type: RoleType;
|
|
15
|
+
};
|
|
16
|
+
interface ApiCredential extends Resource {
|
|
17
|
+
readonly type: ApiCredentialType;
|
|
18
|
+
name: string;
|
|
19
|
+
kind: string;
|
|
20
|
+
confidential?: boolean | null;
|
|
21
|
+
redirect_uri?: string | null;
|
|
22
|
+
client_id?: string | null;
|
|
23
|
+
client_secret?: string | null;
|
|
24
|
+
scopes?: string | null;
|
|
25
|
+
expires_in?: number | null;
|
|
26
|
+
organization?: Organization | null;
|
|
27
|
+
role?: Role | null;
|
|
28
|
+
}
|
|
29
|
+
interface ApiCredentialCreate extends ResourceCreate {
|
|
30
|
+
name: string;
|
|
31
|
+
kind: string;
|
|
32
|
+
redirect_uri?: string | null;
|
|
33
|
+
expires_in?: number | null;
|
|
34
|
+
organization: OrganizationRel;
|
|
35
|
+
role?: RoleRel | null;
|
|
36
|
+
}
|
|
37
|
+
interface ApiCredentialUpdate extends ResourceUpdate {
|
|
38
|
+
name?: string | null;
|
|
39
|
+
redirect_uri?: string | null;
|
|
40
|
+
expires_in?: number | null;
|
|
41
|
+
role?: RoleRel | null;
|
|
42
|
+
}
|
|
43
|
+
declare class ApiCredentials extends ApiResource<ApiCredential> {
|
|
44
|
+
static readonly TYPE: ApiCredentialType;
|
|
45
|
+
create(resource: ApiCredentialCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ApiCredential>;
|
|
46
|
+
update(resource: ApiCredentialUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ApiCredential>;
|
|
47
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
48
|
+
organization(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Organization>;
|
|
49
|
+
role(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Role>;
|
|
50
|
+
isApiCredential(resource: any): resource is ApiCredential;
|
|
51
|
+
relationship(id: string | ResourceId | null): ApiCredentialRel;
|
|
52
|
+
type(): ApiCredentialType;
|
|
53
|
+
}
|
|
54
|
+
export default ApiCredentials;
|
|
55
|
+
export type { ApiCredential, ApiCredentialCreate, ApiCredentialUpdate, ApiCredentialType };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const resource_1 = require("../resource");
|
|
4
|
+
class ApiCredentials extends resource_1.ApiResource {
|
|
5
|
+
async create(resource, params, options) {
|
|
6
|
+
return this.resources.create({ ...resource, type: ApiCredentials.TYPE }, params, options);
|
|
7
|
+
}
|
|
8
|
+
async update(resource, params, options) {
|
|
9
|
+
return this.resources.update({ ...resource, type: ApiCredentials.TYPE }, params, options);
|
|
10
|
+
}
|
|
11
|
+
async delete(id, options) {
|
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: ApiCredentials.TYPE } : id, options);
|
|
13
|
+
}
|
|
14
|
+
async organization(apiCredentialId, params, options) {
|
|
15
|
+
const _apiCredentialId = apiCredentialId.id || apiCredentialId;
|
|
16
|
+
return this.resources.fetch({ type: 'organizations' }, `api_credentials/${_apiCredentialId}/organization`, params, options);
|
|
17
|
+
}
|
|
18
|
+
async role(apiCredentialId, params, options) {
|
|
19
|
+
const _apiCredentialId = apiCredentialId.id || apiCredentialId;
|
|
20
|
+
return this.resources.fetch({ type: 'roles' }, `api_credentials/${_apiCredentialId}/role`, params, options);
|
|
21
|
+
}
|
|
22
|
+
isApiCredential(resource) {
|
|
23
|
+
return resource.type && (resource.type === ApiCredentials.TYPE);
|
|
24
|
+
}
|
|
25
|
+
relationship(id) {
|
|
26
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ApiCredentials.TYPE } : { id: id.id, type: ApiCredentials.TYPE };
|
|
27
|
+
}
|
|
28
|
+
type() {
|
|
29
|
+
return ApiCredentials.TYPE;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
ApiCredentials.TYPE = 'api_credentials';
|
|
33
|
+
exports.default = ApiCredentials;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ApiResource } from '../resource';
|
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
|
4
|
+
import type { Organization, OrganizationType } from './organizations';
|
|
5
|
+
import type { Role, RoleType } from './roles';
|
|
6
|
+
import type { Version } from './versions';
|
|
7
|
+
type MembershipType = 'memberships';
|
|
8
|
+
type MembershipRel = ResourceRel & {
|
|
9
|
+
type: MembershipType;
|
|
10
|
+
};
|
|
11
|
+
type OrganizationRel = ResourceRel & {
|
|
12
|
+
type: OrganizationType;
|
|
13
|
+
};
|
|
14
|
+
type RoleRel = ResourceRel & {
|
|
15
|
+
type: RoleType;
|
|
16
|
+
};
|
|
17
|
+
interface Membership extends Resource {
|
|
18
|
+
readonly type: MembershipType;
|
|
19
|
+
user_email: string;
|
|
20
|
+
status: 'pending' | 'active';
|
|
21
|
+
organization?: Organization | null;
|
|
22
|
+
role?: Role | null;
|
|
23
|
+
versions?: Version[] | null;
|
|
24
|
+
}
|
|
25
|
+
interface MembershipCreate extends ResourceCreate {
|
|
26
|
+
user_email: string;
|
|
27
|
+
organization: OrganizationRel;
|
|
28
|
+
role: RoleRel;
|
|
29
|
+
}
|
|
30
|
+
interface MembershipUpdate extends ResourceUpdate {
|
|
31
|
+
role?: RoleRel | null;
|
|
32
|
+
}
|
|
33
|
+
declare class Memberships extends ApiResource<Membership> {
|
|
34
|
+
static readonly TYPE: MembershipType;
|
|
35
|
+
create(resource: MembershipCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Membership>;
|
|
36
|
+
update(resource: MembershipUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Membership>;
|
|
37
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
38
|
+
organization(membershipId: string | Membership, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Organization>;
|
|
39
|
+
role(membershipId: string | Membership, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Role>;
|
|
40
|
+
versions(membershipId: string | Membership, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
|
41
|
+
isMembership(resource: any): resource is Membership;
|
|
42
|
+
relationship(id: string | ResourceId | null): MembershipRel;
|
|
43
|
+
type(): MembershipType;
|
|
44
|
+
}
|
|
45
|
+
export default Memberships;
|
|
46
|
+
export type { Membership, MembershipCreate, MembershipUpdate, MembershipType };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const resource_1 = require("../resource");
|
|
4
|
+
class Memberships extends resource_1.ApiResource {
|
|
5
|
+
async create(resource, params, options) {
|
|
6
|
+
return this.resources.create({ ...resource, type: Memberships.TYPE }, params, options);
|
|
7
|
+
}
|
|
8
|
+
async update(resource, params, options) {
|
|
9
|
+
return this.resources.update({ ...resource, type: Memberships.TYPE }, params, options);
|
|
10
|
+
}
|
|
11
|
+
async delete(id, options) {
|
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: Memberships.TYPE } : id, options);
|
|
13
|
+
}
|
|
14
|
+
async organization(membershipId, params, options) {
|
|
15
|
+
const _membershipId = membershipId.id || membershipId;
|
|
16
|
+
return this.resources.fetch({ type: 'organizations' }, `memberships/${_membershipId}/organization`, params, options);
|
|
17
|
+
}
|
|
18
|
+
async role(membershipId, params, options) {
|
|
19
|
+
const _membershipId = membershipId.id || membershipId;
|
|
20
|
+
return this.resources.fetch({ type: 'roles' }, `memberships/${_membershipId}/role`, params, options);
|
|
21
|
+
}
|
|
22
|
+
async versions(membershipId, params, options) {
|
|
23
|
+
const _membershipId = membershipId.id || membershipId;
|
|
24
|
+
return this.resources.fetch({ type: 'versions' }, `memberships/${_membershipId}/versions`, params, options);
|
|
25
|
+
}
|
|
26
|
+
isMembership(resource) {
|
|
27
|
+
return resource.type && (resource.type === Memberships.TYPE);
|
|
28
|
+
}
|
|
29
|
+
relationship(id) {
|
|
30
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Memberships.TYPE } : { id: id.id, type: Memberships.TYPE };
|
|
31
|
+
}
|
|
32
|
+
type() {
|
|
33
|
+
return Memberships.TYPE;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
Memberships.TYPE = 'memberships';
|
|
37
|
+
exports.default = Memberships;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ApiResource } from '../resource';
|
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
|
4
|
+
import type { Membership } from './memberships';
|
|
5
|
+
import type { Role } from './roles';
|
|
6
|
+
import type { Permission } from './permissions';
|
|
7
|
+
import type { ApiCredential } from './api_credentials';
|
|
8
|
+
type OrganizationType = 'organizations';
|
|
9
|
+
type OrganizationRel = ResourceRel & {
|
|
10
|
+
type: OrganizationType;
|
|
11
|
+
};
|
|
12
|
+
interface Organization extends Resource {
|
|
13
|
+
readonly type: OrganizationType;
|
|
14
|
+
name: string;
|
|
15
|
+
slug?: string | null;
|
|
16
|
+
domain?: string | null;
|
|
17
|
+
support_phone?: string | null;
|
|
18
|
+
support_email?: string | null;
|
|
19
|
+
logo_url?: string | null;
|
|
20
|
+
favicon_url?: string | null;
|
|
21
|
+
primary_color?: string | null;
|
|
22
|
+
contrast_color?: string | null;
|
|
23
|
+
gtm_id?: string | null;
|
|
24
|
+
gtm_id_test?: string | null;
|
|
25
|
+
discount_disabled?: boolean | null;
|
|
26
|
+
account_disabled?: boolean | null;
|
|
27
|
+
acceptance_disabled?: boolean | null;
|
|
28
|
+
max_concurrent_promotions?: number | null;
|
|
29
|
+
max_concurrent_imports?: number | null;
|
|
30
|
+
associated_markets?: Record<string, any> | null;
|
|
31
|
+
region?: string | null;
|
|
32
|
+
memberships?: Membership[] | null;
|
|
33
|
+
roles?: Role[] | null;
|
|
34
|
+
permissions?: Permission[] | null;
|
|
35
|
+
api_credentials?: ApiCredential[] | null;
|
|
36
|
+
}
|
|
37
|
+
interface OrganizationCreate extends ResourceCreate {
|
|
38
|
+
name: string;
|
|
39
|
+
support_phone?: string | null;
|
|
40
|
+
support_email?: string | null;
|
|
41
|
+
logo_url?: string | null;
|
|
42
|
+
favicon_url?: string | null;
|
|
43
|
+
primary_color?: string | null;
|
|
44
|
+
contrast_color?: string | null;
|
|
45
|
+
gtm_id?: string | null;
|
|
46
|
+
gtm_id_test?: string | null;
|
|
47
|
+
discount_disabled?: boolean | null;
|
|
48
|
+
account_disabled?: boolean | null;
|
|
49
|
+
acceptance_disabled?: boolean | null;
|
|
50
|
+
region?: string | null;
|
|
51
|
+
}
|
|
52
|
+
interface OrganizationUpdate extends ResourceUpdate {
|
|
53
|
+
name?: string | null;
|
|
54
|
+
support_phone?: string | null;
|
|
55
|
+
support_email?: string | null;
|
|
56
|
+
logo_url?: string | null;
|
|
57
|
+
favicon_url?: string | null;
|
|
58
|
+
primary_color?: string | null;
|
|
59
|
+
contrast_color?: string | null;
|
|
60
|
+
gtm_id?: string | null;
|
|
61
|
+
gtm_id_test?: string | null;
|
|
62
|
+
discount_disabled?: boolean | null;
|
|
63
|
+
account_disabled?: boolean | null;
|
|
64
|
+
acceptance_disabled?: boolean | null;
|
|
65
|
+
}
|
|
66
|
+
declare class Organizations extends ApiResource<Organization> {
|
|
67
|
+
static readonly TYPE: OrganizationType;
|
|
68
|
+
create(resource: OrganizationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Organization>;
|
|
69
|
+
update(resource: OrganizationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Organization>;
|
|
70
|
+
memberships(organizationId: string | Organization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Membership>>;
|
|
71
|
+
roles(organizationId: string | Organization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Role>>;
|
|
72
|
+
permissions(organizationId: string | Organization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Permission>>;
|
|
73
|
+
isOrganization(resource: any): resource is Organization;
|
|
74
|
+
relationship(id: string | ResourceId | null): OrganizationRel;
|
|
75
|
+
type(): OrganizationType;
|
|
76
|
+
}
|
|
77
|
+
export default Organizations;
|
|
78
|
+
export type { Organization, OrganizationCreate, OrganizationUpdate, OrganizationType };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const resource_1 = require("../resource");
|
|
4
|
+
class Organizations extends resource_1.ApiResource {
|
|
5
|
+
async create(resource, params, options) {
|
|
6
|
+
return this.resources.create({ ...resource, type: Organizations.TYPE }, params, options);
|
|
7
|
+
}
|
|
8
|
+
async update(resource, params, options) {
|
|
9
|
+
return this.resources.update({ ...resource, type: Organizations.TYPE }, params, options);
|
|
10
|
+
}
|
|
11
|
+
async memberships(organizationId, params, options) {
|
|
12
|
+
const _organizationId = organizationId.id || organizationId;
|
|
13
|
+
return this.resources.fetch({ type: 'memberships' }, `organizations/${_organizationId}/memberships`, params, options);
|
|
14
|
+
}
|
|
15
|
+
async roles(organizationId, params, options) {
|
|
16
|
+
const _organizationId = organizationId.id || organizationId;
|
|
17
|
+
return this.resources.fetch({ type: 'roles' }, `organizations/${_organizationId}/roles`, params, options);
|
|
18
|
+
}
|
|
19
|
+
async permissions(organizationId, params, options) {
|
|
20
|
+
const _organizationId = organizationId.id || organizationId;
|
|
21
|
+
return this.resources.fetch({ type: 'permissions' }, `organizations/${_organizationId}/permissions`, params, options);
|
|
22
|
+
}
|
|
23
|
+
isOrganization(resource) {
|
|
24
|
+
return resource.type && (resource.type === Organizations.TYPE);
|
|
25
|
+
}
|
|
26
|
+
relationship(id) {
|
|
27
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Organizations.TYPE } : { id: id.id, type: Organizations.TYPE };
|
|
28
|
+
}
|
|
29
|
+
type() {
|
|
30
|
+
return Organizations.TYPE;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
Organizations.TYPE = 'organizations';
|
|
34
|
+
exports.default = Organizations;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ApiResource } from '../resource';
|
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
|
3
|
+
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
|
4
|
+
import type { Organization } from './organizations';
|
|
5
|
+
import type { Role, RoleType } from './roles';
|
|
6
|
+
import type { Version } from './versions';
|
|
7
|
+
type PermissionType = 'permissions';
|
|
8
|
+
type PermissionRel = ResourceRel & {
|
|
9
|
+
type: PermissionType;
|
|
10
|
+
};
|
|
11
|
+
type RoleRel = ResourceRel & {
|
|
12
|
+
type: RoleType;
|
|
13
|
+
};
|
|
14
|
+
interface Permission extends Resource {
|
|
15
|
+
readonly type: PermissionType;
|
|
16
|
+
can_create: boolean;
|
|
17
|
+
can_read: boolean;
|
|
18
|
+
can_update: boolean;
|
|
19
|
+
can_destroy: boolean;
|
|
20
|
+
subject: string;
|
|
21
|
+
restrictions?: Record<string, any> | null;
|
|
22
|
+
organization?: Organization | null;
|
|
23
|
+
role?: Role | null;
|
|
24
|
+
versions?: Version[] | null;
|
|
25
|
+
}
|
|
26
|
+
interface PermissionCreate extends ResourceCreate {
|
|
27
|
+
can_create: boolean;
|
|
28
|
+
can_read: boolean;
|
|
29
|
+
can_update: boolean;
|
|
30
|
+
can_destroy: boolean;
|
|
31
|
+
subject: string;
|
|
32
|
+
role: RoleRel;
|
|
33
|
+
}
|
|
34
|
+
interface PermissionUpdate extends ResourceUpdate {
|
|
35
|
+
can_create?: boolean | null;
|
|
36
|
+
can_read?: boolean | null;
|
|
37
|
+
can_update?: boolean | null;
|
|
38
|
+
can_destroy?: boolean | null;
|
|
39
|
+
}
|
|
40
|
+
declare class Permissions extends ApiResource<Permission> {
|
|
41
|
+
static readonly TYPE: PermissionType;
|
|
42
|
+
create(resource: PermissionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Permission>;
|
|
43
|
+
update(resource: PermissionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Permission>;
|
|
44
|
+
organization(permissionId: string | Permission, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Organization>;
|
|
45
|
+
role(permissionId: string | Permission, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Role>;
|
|
46
|
+
versions(permissionId: string | Permission, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
|
47
|
+
isPermission(resource: any): resource is Permission;
|
|
48
|
+
relationship(id: string | ResourceId | null): PermissionRel;
|
|
49
|
+
type(): PermissionType;
|
|
50
|
+
}
|
|
51
|
+
export default Permissions;
|
|
52
|
+
export type { Permission, PermissionCreate, PermissionUpdate, PermissionType };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const resource_1 = require("../resource");
|
|
4
|
+
class Permissions extends resource_1.ApiResource {
|
|
5
|
+
async create(resource, params, options) {
|
|
6
|
+
return this.resources.create({ ...resource, type: Permissions.TYPE }, params, options);
|
|
7
|
+
}
|
|
8
|
+
async update(resource, params, options) {
|
|
9
|
+
return this.resources.update({ ...resource, type: Permissions.TYPE }, params, options);
|
|
10
|
+
}
|
|
11
|
+
async organization(permissionId, params, options) {
|
|
12
|
+
const _permissionId = permissionId.id || permissionId;
|
|
13
|
+
return this.resources.fetch({ type: 'organizations' }, `permissions/${_permissionId}/organization`, params, options);
|
|
14
|
+
}
|
|
15
|
+
async role(permissionId, params, options) {
|
|
16
|
+
const _permissionId = permissionId.id || permissionId;
|
|
17
|
+
return this.resources.fetch({ type: 'roles' }, `permissions/${_permissionId}/role`, params, options);
|
|
18
|
+
}
|
|
19
|
+
async versions(permissionId, params, options) {
|
|
20
|
+
const _permissionId = permissionId.id || permissionId;
|
|
21
|
+
return this.resources.fetch({ type: 'versions' }, `permissions/${_permissionId}/versions`, params, options);
|
|
22
|
+
}
|
|
23
|
+
isPermission(resource) {
|
|
24
|
+
return resource.type && (resource.type === Permissions.TYPE);
|
|
25
|
+
}
|
|
26
|
+
relationship(id) {
|
|
27
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: Permissions.TYPE } : { id: id.id, type: Permissions.TYPE };
|
|
28
|
+
}
|
|
29
|
+
type() {
|
|
30
|
+
return Permissions.TYPE;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
Permissions.TYPE = 'permissions';
|
|
34
|
+
exports.default = Permissions;
|