@wix/auth-management 1.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.
Files changed (31) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +24 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/headless-v1-o-auth-app.http.d.ts +35 -0
  5. package/build/cjs/src/headless-v1-o-auth-app.http.js +167 -0
  6. package/build/cjs/src/headless-v1-o-auth-app.http.js.map +1 -0
  7. package/build/cjs/src/headless-v1-o-auth-app.public.d.ts +11 -0
  8. package/build/cjs/src/headless-v1-o-auth-app.public.js +32 -0
  9. package/build/cjs/src/headless-v1-o-auth-app.public.js.map +1 -0
  10. package/build/cjs/src/headless-v1-o-auth-app.types.d.ts +153 -0
  11. package/build/cjs/src/headless-v1-o-auth-app.types.js +9 -0
  12. package/build/cjs/src/headless-v1-o-auth-app.types.js.map +1 -0
  13. package/build/cjs/src/headless-v1-o-auth-app.universal.d.ts +293 -0
  14. package/build/cjs/src/headless-v1-o-auth-app.universal.js +305 -0
  15. package/build/cjs/src/headless-v1-o-auth-app.universal.js.map +1 -0
  16. package/build/es/index.d.ts +1 -0
  17. package/build/es/index.js +2 -0
  18. package/build/es/index.js.map +1 -0
  19. package/build/es/src/headless-v1-o-auth-app.http.d.ts +35 -0
  20. package/build/es/src/headless-v1-o-auth-app.http.js +160 -0
  21. package/build/es/src/headless-v1-o-auth-app.http.js.map +1 -0
  22. package/build/es/src/headless-v1-o-auth-app.public.d.ts +11 -0
  23. package/build/es/src/headless-v1-o-auth-app.public.js +24 -0
  24. package/build/es/src/headless-v1-o-auth-app.public.js.map +1 -0
  25. package/build/es/src/headless-v1-o-auth-app.types.d.ts +153 -0
  26. package/build/es/src/headless-v1-o-auth-app.types.js +6 -0
  27. package/build/es/src/headless-v1-o-auth-app.types.js.map +1 -0
  28. package/build/es/src/headless-v1-o-auth-app.universal.d.ts +293 -0
  29. package/build/es/src/headless-v1-o-auth-app.universal.js +279 -0
  30. package/build/es/src/headless-v1-o-auth-app.universal.js.map +1 -0
  31. package/package.json +37 -0
@@ -0,0 +1 @@
1
+ export * as oAuthApps from './src/headless-v1-o-auth-app.public';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.oAuthApps = void 0;
23
+ exports.oAuthApps = __importStar(require("./src/headless-v1-o-auth-app.public"));
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iFAAiE"}
@@ -0,0 +1,35 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ import { CreateOAuthAppRequest, CreateOAuthAppResponse, GetOAuthAppRequest, GetOAuthAppResponse, QueryOAuthAppsRequest, QueryOAuthAppsResponse, UpdateOAuthAppRequest, UpdateOAuthAppResponse } from './headless-v1-o-auth-app.types';
3
+ /**
4
+ * Creates a new OAuth app for a Wix Headless client.
5
+ *
6
+ *
7
+ * An OAuth app authorizes an external client app or site, on any platform, to authenticate with a Wix site or project and manage its data.
8
+ *
9
+ * > **Note:** The OAuth app secret is returned only when creating the OAuth app, and can't be retrieved later. Store the secret in a secure location.
10
+ */
11
+ export declare function createOAuthApp(payload: CreateOAuthAppRequest): RequestOptionsFactory<CreateOAuthAppResponse>;
12
+ /** Retrieves an OAuth app by ID. */
13
+ export declare function getOAuthApp(payload: GetOAuthAppRequest): RequestOptionsFactory<GetOAuthAppResponse>;
14
+ /**
15
+ * Updates an OAuth app.
16
+ *
17
+ *
18
+ * Only fields provided in `mask` are updated.
19
+ *
20
+ * You can update the following fields:
21
+ * + `name`
22
+ * + `description`
23
+ * + `allowedDomain`
24
+ * + `loginUrl`
25
+ */
26
+ export declare function updateOAuthApp(payload: UpdateOAuthAppRequest): RequestOptionsFactory<UpdateOAuthAppResponse>;
27
+ /**
28
+ * Retrieves a list of OAuth apps, given the provided paging, filtering, and sorting.
29
+ *
30
+ *
31
+ * Query OAuth Apps runs with these defaults, which you can override:
32
+ * + Results are sorted by `id` in descending order.
33
+ * + `paging.offset` is `0`.
34
+ */
35
+ export declare function queryOAuthApps(payload: QueryOAuthAppsRequest): RequestOptionsFactory<QueryOAuthAppsResponse>;
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.queryOAuthApps = exports.updateOAuthApp = exports.getOAuthApp = exports.createOAuthApp = void 0;
4
+ const metro_runtime_1 = require("@wix/metro-runtime");
5
+ const ambassador_1 = require("@wix/metro-runtime/ambassador");
6
+ const metro_runtime_2 = require("@wix/metro-runtime");
7
+ const _createOAuthAppRequest = { oAuthApp: '_oAuthApp' };
8
+ const _createOAuthAppResponse = { oAuthApp: '_oAuthApp' };
9
+ const _getOAuthAppRequest = {};
10
+ const _getOAuthAppResponse = { oAuthApp: '_oAuthApp' };
11
+ const _oAuthApp = { createdDate: 'google.protobuf.Timestamp' };
12
+ const _queryOAuthAppsRequest = {};
13
+ const _queryOAuthAppsResponse = { oAuthApps: '_oAuthApp' };
14
+ const _updateOAuthAppRequest = {
15
+ mask: 'google.protobuf.FieldMask',
16
+ oAuthApp: '_oAuthApp',
17
+ };
18
+ const _updateOAuthAppResponse = { oAuthApp: '_oAuthApp' };
19
+ function resolveWixHeadlessV1OAuthAppServiceUrl(opts) {
20
+ const domainToMappings = {
21
+ 'manage._base_domain_': [
22
+ {
23
+ srcPath: '/oauth-app-service',
24
+ destPath: '',
25
+ },
26
+ {
27
+ srcPath: '/oauth-app',
28
+ destPath: '',
29
+ },
30
+ ],
31
+ 'www.wixapis.com': [
32
+ {
33
+ srcPath: '/oauth-app',
34
+ destPath: '',
35
+ },
36
+ ],
37
+ };
38
+ return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
39
+ }
40
+ /**
41
+ * Creates a new OAuth app for a Wix Headless client.
42
+ *
43
+ *
44
+ * An OAuth app authorizes an external client app or site, on any platform, to authenticate with a Wix site or project and manage its data.
45
+ *
46
+ * > **Note:** The OAuth app secret is returned only when creating the OAuth app, and can't be retrieved later. Store the secret in a secure location.
47
+ */
48
+ function createOAuthApp(payload) {
49
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_createOAuthAppRequest, { _oAuthApp });
50
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_createOAuthAppResponse, {
51
+ _oAuthApp,
52
+ });
53
+ function __createOAuthApp({ host }) {
54
+ const serializedData = toReq(payload);
55
+ const metadata = {
56
+ entityFqdn: 'wix.headless.v1.o_auth_app',
57
+ method: 'POST',
58
+ methodFqn: 'wix.headless.v1.OAuthAppService.CreateOAuthApp',
59
+ url: resolveWixHeadlessV1OAuthAppServiceUrl({
60
+ protoPath: '/v1/oauth-apps',
61
+ data: serializedData,
62
+ host,
63
+ }),
64
+ data: serializedData,
65
+ transformResponse: fromRes,
66
+ };
67
+ return metadata;
68
+ }
69
+ __createOAuthApp.fromReq = fromReq;
70
+ return __createOAuthApp;
71
+ }
72
+ exports.createOAuthApp = createOAuthApp;
73
+ /** Retrieves an OAuth app by ID. */
74
+ function getOAuthApp(payload) {
75
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_getOAuthAppRequest, {});
76
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_getOAuthAppResponse, { _oAuthApp });
77
+ function __getOAuthApp({ host }) {
78
+ const serializedData = toReq(payload);
79
+ const metadata = {
80
+ entityFqdn: 'wix.headless.v1.o_auth_app',
81
+ method: 'GET',
82
+ methodFqn: 'wix.headless.v1.OAuthAppService.GetOAuthApp',
83
+ url: resolveWixHeadlessV1OAuthAppServiceUrl({
84
+ protoPath: '/v1/oauth-apps/{oAuthAppId}',
85
+ data: serializedData,
86
+ host,
87
+ }),
88
+ params: (0, metro_runtime_1.toURLSearchParams)(serializedData),
89
+ transformResponse: fromRes,
90
+ };
91
+ return metadata;
92
+ }
93
+ __getOAuthApp.fromReq = fromReq;
94
+ return __getOAuthApp;
95
+ }
96
+ exports.getOAuthApp = getOAuthApp;
97
+ /**
98
+ * Updates an OAuth app.
99
+ *
100
+ *
101
+ * Only fields provided in `mask` are updated.
102
+ *
103
+ * You can update the following fields:
104
+ * + `name`
105
+ * + `description`
106
+ * + `allowedDomain`
107
+ * + `loginUrl`
108
+ */
109
+ function updateOAuthApp(payload) {
110
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_updateOAuthAppRequest, { _oAuthApp });
111
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_updateOAuthAppResponse, {
112
+ _oAuthApp,
113
+ });
114
+ function __updateOAuthApp({ host }) {
115
+ const serializedData = toReq(payload);
116
+ const metadata = {
117
+ entityFqdn: 'wix.headless.v1.o_auth_app',
118
+ method: 'PATCH',
119
+ methodFqn: 'wix.headless.v1.OAuthAppService.UpdateOAuthApp',
120
+ url: resolveWixHeadlessV1OAuthAppServiceUrl({
121
+ protoPath: '/v1/oauth-apps/{oAuthApp.id}',
122
+ data: serializedData,
123
+ host,
124
+ }),
125
+ data: serializedData,
126
+ transformResponse: fromRes,
127
+ };
128
+ return metadata;
129
+ }
130
+ __updateOAuthApp.fromReq = fromReq;
131
+ return __updateOAuthApp;
132
+ }
133
+ exports.updateOAuthApp = updateOAuthApp;
134
+ /**
135
+ * Retrieves a list of OAuth apps, given the provided paging, filtering, and sorting.
136
+ *
137
+ *
138
+ * Query OAuth Apps runs with these defaults, which you can override:
139
+ * + Results are sorted by `id` in descending order.
140
+ * + `paging.offset` is `0`.
141
+ */
142
+ function queryOAuthApps(payload) {
143
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_queryOAuthAppsRequest, {});
144
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_queryOAuthAppsResponse, {
145
+ _oAuthApp,
146
+ });
147
+ function __queryOAuthApps({ host }) {
148
+ const serializedData = toReq(payload);
149
+ const metadata = {
150
+ entityFqdn: 'wix.headless.v1.o_auth_app',
151
+ method: 'POST',
152
+ methodFqn: 'wix.headless.v1.OAuthAppService.QueryOAuthApps',
153
+ url: resolveWixHeadlessV1OAuthAppServiceUrl({
154
+ protoPath: '/v1/oauth-apps/query',
155
+ data: serializedData,
156
+ host,
157
+ }),
158
+ data: serializedData,
159
+ transformResponse: fromRes,
160
+ };
161
+ return metadata;
162
+ }
163
+ __queryOAuthApps.fromReq = fromReq;
164
+ return __queryOAuthApps;
165
+ }
166
+ exports.queryOAuthApps = queryOAuthApps;
167
+ //# sourceMappingURL=headless-v1-o-auth-app.http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-v1-o-auth-app.http.js","sourceRoot":"","sources":["../../../src/headless-v1-o-auth-app.http.ts"],"names":[],"mappings":";;;AAAA,sDAAuD;AACvD,8DAA2D;AAC3D,sDAAgD;AAchD,MAAM,sBAAsB,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AACzD,MAAM,uBAAuB,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,CAA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,GAAG;YACf,UAAU,EAAE,4BAA4B;YACxC,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,gDAAgD;YAC3D,GAAG,EAAE,sCAAsC,CAAC;gBAC1C,SAAS,EAAE,sBAAsB;gBACjC,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gBAAgB,CAAC,OAAO,GAAG,OAAO,CAAC;IAEnC,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAhCD,wCAgCC"}
@@ -0,0 +1,11 @@
1
+ import { HttpClient } from '@wix/sdk-types';
2
+ import { OAuthApp, UpdateOAuthApp } from './headless-v1-o-auth-app.universal';
3
+ export declare const __metadata: {
4
+ PACKAGE_NAME: string;
5
+ };
6
+ export declare function createOAuthApp(httpClient: HttpClient): (oAuthApp: OAuthApp) => Promise<OAuthApp>;
7
+ export declare function getOAuthApp(httpClient: HttpClient): (oAuthAppId: string) => Promise<OAuthApp>;
8
+ export declare function updateOAuthApp(httpClient: HttpClient): (_id: string | null, oAuthApp: UpdateOAuthApp, mask: string[]) => Promise<OAuthApp>;
9
+ export declare function queryOAuthApps(httpClient: HttpClient): () => import("./headless-v1-o-auth-app.universal").OAuthAppsQueryBuilder;
10
+ export { SortOrder } from './headless-v1-o-auth-app.universal';
11
+ export { OAuthApp, CreateOAuthAppRequest, CreateOAuthAppResponse, GetOAuthAppRequest, GetOAuthAppResponse, UpdateOAuthAppRequest, UpdateOAuthAppResponse, DeleteOAuthAppRequest, DeleteOAuthAppResponse, QueryOAuthAppsRequest, PlatformQuery, PlatformQueryPagingMethodOneOf, Sorting, Paging, CursorPaging, QueryOAuthAppsResponse, PagingMetadataV2, Cursors, UpdateOAuthApp, OAuthAppsQueryResult, OAuthAppsQueryBuilder, } from './headless-v1-o-auth-app.universal';
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SortOrder = exports.queryOAuthApps = exports.updateOAuthApp = exports.getOAuthApp = exports.createOAuthApp = exports.__metadata = void 0;
4
+ const headless_v1_o_auth_app_universal_1 = require("./headless-v1-o-auth-app.universal");
5
+ exports.__metadata = { PACKAGE_NAME: '@wix/auth-management' };
6
+ function createOAuthApp(httpClient) {
7
+ return (oAuthApp) => (0, headless_v1_o_auth_app_universal_1.createOAuthApp)(oAuthApp,
8
+ // @ts-ignore
9
+ { httpClient });
10
+ }
11
+ exports.createOAuthApp = createOAuthApp;
12
+ function getOAuthApp(httpClient) {
13
+ return (oAuthAppId) => (0, headless_v1_o_auth_app_universal_1.getOAuthApp)(oAuthAppId,
14
+ // @ts-ignore
15
+ { httpClient });
16
+ }
17
+ exports.getOAuthApp = getOAuthApp;
18
+ function updateOAuthApp(httpClient) {
19
+ return (_id, oAuthApp, mask) => (0, headless_v1_o_auth_app_universal_1.updateOAuthApp)(_id, oAuthApp, mask,
20
+ // @ts-ignore
21
+ { httpClient });
22
+ }
23
+ exports.updateOAuthApp = updateOAuthApp;
24
+ function queryOAuthApps(httpClient) {
25
+ return () => (0, headless_v1_o_auth_app_universal_1.queryOAuthApps)(
26
+ // @ts-ignore
27
+ { httpClient });
28
+ }
29
+ exports.queryOAuthApps = queryOAuthApps;
30
+ var headless_v1_o_auth_app_universal_2 = require("./headless-v1-o-auth-app.universal");
31
+ Object.defineProperty(exports, "SortOrder", { enumerable: true, get: function () { return headless_v1_o_auth_app_universal_2.SortOrder; } });
32
+ //# sourceMappingURL=headless-v1-o-auth-app.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-v1-o-auth-app.public.js","sourceRoot":"","sources":["../../../src/headless-v1-o-auth-app.public.ts"],"names":[],"mappings":";;;AACA,yFAO4C;AAE/B,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAEnE,SAAgB,cAAc,CAAC,UAAsB;IACnD,OAAO,CAAC,QAAkB,EAAE,EAAE,CAC5B,IAAA,iDAAuB,EACrB,QAAQ;IACR,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,wCAOC;AAED,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,UAAkB,EAAE,EAAE,CAC5B,IAAA,8CAAoB,EAClB,UAAU;IACV,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,kCAOC;AAED,SAAgB,cAAc,CAAC,UAAsB;IACnD,OAAO,CAAC,GAAkB,EAAE,QAAwB,EAAE,IAAc,EAAE,EAAE,CACtE,IAAA,iDAAuB,EACrB,GAAG,EACH,QAAQ,EACR,IAAI;IACJ,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AATD,wCASC;AAED,SAAgB,cAAc,CAAC,UAAsB;IACnD,OAAO,GAAG,EAAE,CACV,IAAA,iDAAuB;IACrB,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAND,wCAMC;AAED,uFAA+D;AAAtD,6HAAA,SAAS,OAAA"}
@@ -0,0 +1,153 @@
1
+ /** An intermediary application that authorizes and authenticates an external client to access data on a Wix project or site. */
2
+ export interface OAuthApp {
3
+ /**
4
+ * ID of the OAuth app.
5
+ * @readonly
6
+ */
7
+ id?: string | null;
8
+ /**
9
+ * Date and time the OAuth app was created, in ISO 8601 format.
10
+ * @readonly
11
+ */
12
+ createdDate?: Date;
13
+ /** Display name of the OAuth app, as it appears in the dashboard. */
14
+ name?: string | null;
15
+ /** Description of the OAuth app, as it appears in the dashboard. */
16
+ description?: string | null;
17
+ /**
18
+ * Client secret for the OAuth app. **Note:** This is returned only when the OAuth app is created. It can't be retrieved later.
19
+ * @readonly
20
+ */
21
+ secret?: string | null;
22
+ /** External login URL to which users are redirected automatically to authenticate. If no login URL is specified, the user is redirected to Wix to authenticate. */
23
+ loginUrl?: string | null;
24
+ /**
25
+ * List of URIs to which redirection from Wix is allowed after authentication.
26
+ *
27
+ * When a client redirects a user to Wix for authentication, the client provides a URI to redirect the user back to after the user has been authenticated.
28
+ * Wix only redirects the user if the exact URI is contained in this array.
29
+ */
30
+ allowedRedirectUris?: string[];
31
+ /**
32
+ * List of domains to which redirection from Wix is allowed after processes other than authentication.
33
+ *
34
+ * When a client redirects a user to a Wix page (for example, for checkout), the client provides a URL to redirect the user back to.
35
+ * Wix only redirects the user if the URL is in one of the specified domains.
36
+ */
37
+ allowedRedirectDomains?: string[];
38
+ }
39
+ export interface CreateOAuthAppRequest {
40
+ /** OAuth app to create. */
41
+ oAuthApp: OAuthApp;
42
+ }
43
+ export interface CreateOAuthAppResponse {
44
+ /** Created OAuth app info. */
45
+ oAuthApp?: OAuthApp;
46
+ }
47
+ export interface GetOAuthAppRequest {
48
+ /** ID of the OAuth app to retrieve. */
49
+ oAuthAppId: string;
50
+ }
51
+ export interface GetOAuthAppResponse {
52
+ /** Retrieved OAuth app info. */
53
+ oAuthApp?: OAuthApp;
54
+ }
55
+ export interface UpdateOAuthAppRequest {
56
+ /** Updated OAuth app details. May include some or all fields. */
57
+ oAuthApp: OAuthApp;
58
+ /** Explicit list of fields to update. Only fields listed are updated. */
59
+ mask: string[];
60
+ }
61
+ export interface UpdateOAuthAppResponse {
62
+ /** Updated OAuth app info. */
63
+ oAuthApp?: OAuthApp;
64
+ }
65
+ export interface DeleteOAuthAppRequest {
66
+ /** ID of the OAuth app to delete. */
67
+ oAuthAppId?: string;
68
+ }
69
+ export interface DeleteOAuthAppResponse {
70
+ }
71
+ export interface QueryOAuthAppsRequest {
72
+ /** Query options. */
73
+ query?: PlatformQuery;
74
+ }
75
+ export interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
76
+ /** Paging options to limit and skip the number of items. */
77
+ paging?: Paging;
78
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
79
+ cursorPaging?: CursorPaging;
80
+ /**
81
+ * Filter object in the following format:
82
+ * `"filter" : {
83
+ * "fieldName1": "value1",
84
+ * "fieldName2":{"$operator":"value2"}
85
+ * }`
86
+ * Example of operators: `$eq`
87
+ */
88
+ filter?: Record<string, any> | null;
89
+ /**
90
+ * Sort object in the following format:
91
+ * `[{"fieldName":"name","order":"ASC"},{"fieldName":"created_date","order":"DESC"}]`
92
+ */
93
+ sort?: Sorting[];
94
+ }
95
+ /** @oneof */
96
+ export interface PlatformQueryPagingMethodOneOf {
97
+ /** Paging options to limit and skip the number of items. */
98
+ paging?: Paging;
99
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
100
+ cursorPaging?: CursorPaging;
101
+ }
102
+ export interface Sorting {
103
+ /** Name of the field to sort by. */
104
+ fieldName?: string;
105
+ /** Sort order. */
106
+ order?: SortOrder;
107
+ }
108
+ export declare enum SortOrder {
109
+ ASC = "ASC",
110
+ DESC = "DESC"
111
+ }
112
+ export interface Paging {
113
+ /** Number of items to load. */
114
+ limit?: number | null;
115
+ /** Number of items to skip in the current sort order. */
116
+ offset?: number | null;
117
+ }
118
+ export interface CursorPaging {
119
+ /** Number of items to load. */
120
+ limit?: number | null;
121
+ /**
122
+ * Pointer to the next or previous page in the list of results.
123
+ *
124
+ * You can get the relevant cursor token
125
+ * from the `pagingMetadata` object in the previous call's response.
126
+ * Not relevant for the first request.
127
+ */
128
+ cursor?: string | null;
129
+ }
130
+ export interface QueryOAuthAppsResponse {
131
+ /** List of OAuth apps matching the query. */
132
+ oAuthApps?: OAuthApp[];
133
+ /** Paging metadata. */
134
+ pagingMetadata?: PagingMetadataV2;
135
+ }
136
+ export interface PagingMetadataV2 {
137
+ /** Number of items returned in the response. */
138
+ count?: number | null;
139
+ /** Offset that was requested. */
140
+ offset?: number | null;
141
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
142
+ total?: number | null;
143
+ /** Flag that indicates the server failed to calculate the `total` field. */
144
+ tooManyToCount?: boolean | null;
145
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
146
+ cursors?: Cursors;
147
+ }
148
+ export interface Cursors {
149
+ /** Cursor pointing to next page in the list of results. */
150
+ next?: string | null;
151
+ /** Cursor pointing to previous page in the list of results. */
152
+ prev?: string | null;
153
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SortOrder = void 0;
4
+ var SortOrder;
5
+ (function (SortOrder) {
6
+ SortOrder["ASC"] = "ASC";
7
+ SortOrder["DESC"] = "DESC";
8
+ })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
9
+ //# sourceMappingURL=headless-v1-o-auth-app.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-v1-o-auth-app.types.js","sourceRoot":"","sources":["../../../src/headless-v1-o-auth-app.types.ts"],"names":[],"mappings":";;;AAuHA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}