powersync 0.1.0 → 0.1.2
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/README.md +14 -14
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.js +11 -8
- package/dist/commands/instance/sync-rules/generate-schema.js +6 -6
- package/dist/constants.d.ts +2 -5
- package/dist/constants.js +4 -2
- package/dist/service/accounts.client.js +11129 -25
- package/dist/service/powersync.client.js +37453 -113
- package/dist/service/types.js +1 -1
- package/dist/service/utils.js +6 -6
- package/dist/utils.js +5 -7
- package/oclif.manifest.json +1 -1
- package/package.json +28 -20
- package/dist/powersync-sdk/accounts/api.d.ts +0 -717
- package/dist/powersync-sdk/accounts/api.js +0 -182
- package/dist/powersync-sdk/accounts/client.d.ts +0 -1096
- package/dist/powersync-sdk/accounts/client.js +0 -124
- package/dist/powersync-sdk/accounts/codecs.d.ts +0 -32
- package/dist/powersync-sdk/accounts/codecs.js +0 -93
- package/dist/powersync-sdk/accounts/index.d.ts +0 -4
- package/dist/powersync-sdk/accounts/index.js +0 -4
- package/dist/powersync-sdk/accounts/models.d.ts +0 -260
- package/dist/powersync-sdk/accounts/models.js +0 -96
- package/dist/powersync-sdk/accounts/routes.d.ts +0 -44
- package/dist/powersync-sdk/accounts/routes.js +0 -45
- package/dist/powersync-sdk/accounts/source.d.ts +0 -76
- package/dist/powersync-sdk/accounts/source.js +0 -32
- package/dist/powersync-sdk/errors/errors.d.ts +0 -62
- package/dist/powersync-sdk/errors/errors.js +0 -115
- package/dist/powersync-sdk/errors/index.d.ts +0 -2
- package/dist/powersync-sdk/errors/index.js +0 -2
- package/dist/powersync-sdk/errors/utils.d.ts +0 -4
- package/dist/powersync-sdk/errors/utils.js +0 -18
- package/dist/powersync-sdk/fetch-clients/codecs.d.ts +0 -4
- package/dist/powersync-sdk/fetch-clients/codecs.js +0 -34
- package/dist/powersync-sdk/fetch-clients/decoders.d.ts +0 -3
- package/dist/powersync-sdk/fetch-clients/decoders.js +0 -35
- package/dist/powersync-sdk/fetch-clients/definitions.d.ts +0 -97
- package/dist/powersync-sdk/fetch-clients/definitions.js +0 -22
- package/dist/powersync-sdk/fetch-clients/errors.d.ts +0 -7
- package/dist/powersync-sdk/fetch-clients/errors.js +0 -19
- package/dist/powersync-sdk/fetch-clients/index.d.ts +0 -5
- package/dist/powersync-sdk/fetch-clients/index.js +0 -5
- package/dist/powersync-sdk/fetch-clients/node-client.d.ts +0 -9
- package/dist/powersync-sdk/fetch-clients/node-client.js +0 -107
- package/dist/powersync-sdk/fetch-clients/request.d.ts +0 -11
- package/dist/powersync-sdk/fetch-clients/request.js +0 -138
- package/dist/powersync-sdk/fetch-clients/streaming.d.ts +0 -65
- package/dist/powersync-sdk/fetch-clients/streaming.js +0 -99
- package/dist/powersync-sdk/fetch-clients/utils.d.ts +0 -13
- package/dist/powersync-sdk/fetch-clients/utils.js +0 -43
- package/dist/powersync-sdk/fetch-clients/web-client.d.ts +0 -14
- package/dist/powersync-sdk/fetch-clients/web-client.js +0 -56
- package/dist/powersync-sdk/json/index.d.ts +0 -4
- package/dist/powersync-sdk/json/index.js +0 -3
- package/dist/powersync-sdk/json/json.d.ts +0 -5
- package/dist/powersync-sdk/json/json.js +0 -35
- package/dist/powersync-sdk/json/json_container.d.ts +0 -18
- package/dist/powersync-sdk/json/json_container.js +0 -28
- package/dist/powersync-sdk/json/json_stringify.d.ts +0 -36
- package/dist/powersync-sdk/json/json_stringify.js +0 -162
- package/dist/powersync-sdk/powersync/client.d.ts +0 -449
- package/dist/powersync-sdk/powersync/client.js +0 -53
- package/dist/powersync-sdk/powersync/config/HostedConfig.d.ts +0 -327
- package/dist/powersync-sdk/powersync/config/HostedConfig.js +0 -92
- package/dist/powersync-sdk/powersync/config/PowerSyncConfig.d.ts +0 -211
- package/dist/powersync-sdk/powersync/config/PowerSyncConfig.js +0 -97
- package/dist/powersync-sdk/powersync/config/normalize.d.ts +0 -32
- package/dist/powersync-sdk/powersync/config/normalize.js +0 -85
- package/dist/powersync-sdk/powersync/definitions.d.ts +0 -149
- package/dist/powersync-sdk/powersync/definitions.js +0 -97
- package/dist/powersync-sdk/powersync/index.d.ts +0 -8
- package/dist/powersync-sdk/powersync/index.js +0 -8
- package/dist/powersync-sdk/powersync/internal_routes.d.ts +0 -247
- package/dist/powersync-sdk/powersync/internal_routes.js +0 -69
- package/dist/powersync-sdk/powersync/routes.d.ts +0 -779
- package/dist/powersync-sdk/powersync/routes.js +0 -191
- package/dist/powersync-sdk/sdk-clients/endpoints.d.ts +0 -31
- package/dist/powersync-sdk/sdk-clients/endpoints.js +0 -48
- package/dist/powersync-sdk/sdk-clients/index.d.ts +0 -3
- package/dist/powersync-sdk/sdk-clients/index.js +0 -3
- package/dist/powersync-sdk/sdk-clients/pagination.d.ts +0 -14
- package/dist/powersync-sdk/sdk-clients/pagination.js +0 -21
- package/dist/powersync-sdk/sdk-clients/sdk-client.d.ts +0 -17
- package/dist/powersync-sdk/sdk-clients/sdk-client.js +0 -30
- package/dist/powersync-sdk/streaming/bson/buffer-array.d.ts +0 -31
- package/dist/powersync-sdk/streaming/bson/buffer-array.js +0 -79
- package/dist/powersync-sdk/streaming/bson/constants.d.ts +0 -2
- package/dist/powersync-sdk/streaming/bson/constants.js +0 -1
- package/dist/powersync-sdk/streaming/bson/decoder.d.ts +0 -10
- package/dist/powersync-sdk/streaming/bson/decoder.js +0 -62
- package/dist/powersync-sdk/streaming/bson/encoder.d.ts +0 -10
- package/dist/powersync-sdk/streaming/bson/encoder.js +0 -23
- package/dist/powersync-sdk/streaming/bson/header.d.ts +0 -11
- package/dist/powersync-sdk/streaming/bson/header.js +0 -52
- package/dist/powersync-sdk/streaming/bson/index.d.ts +0 -5
- package/dist/powersync-sdk/streaming/bson/index.js +0 -5
- package/dist/powersync-sdk/streaming/core/backpressure.d.ts +0 -15
- package/dist/powersync-sdk/streaming/core/backpressure.js +0 -34
- package/dist/powersync-sdk/streaming/core/cross-stream.d.ts +0 -6
- package/dist/powersync-sdk/streaming/core/cross-stream.js +0 -17
- package/dist/powersync-sdk/streaming/core/index.d.ts +0 -4
- package/dist/powersync-sdk/streaming/core/index.js +0 -4
- package/dist/powersync-sdk/streaming/core/node-utils.d.ts +0 -7
- package/dist/powersync-sdk/streaming/core/node-utils.js +0 -11
- package/dist/powersync-sdk/streaming/core/transformers.d.ts +0 -41
- package/dist/powersync-sdk/streaming/core/transformers.js +0 -70
- package/dist/powersync-sdk/streaming/core/utils.d.ts +0 -36
- package/dist/powersync-sdk/streaming/core/utils.js +0 -66
- package/dist/powersync-sdk/streaming/index.d.ts +0 -3
- package/dist/powersync-sdk/streaming/index.js +0 -3
- package/dist/powersync-sdk/streaming/web.d.ts +0 -4
- package/dist/powersync-sdk/streaming/web.js +0 -4
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binaryreader.d.ts +0 -2
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binaryreader.js +0 -36
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binarywriter.d.ts +0 -2
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binarywriter.js +0 -58
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometry.d.ts +0 -18
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometry.js +0 -348
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometrycollection.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometrycollection.js +0 -118
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/linestring.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/linestring.js +0 -131
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multilinestring.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multilinestring.js +0 -134
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipoint.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipoint.js +0 -122
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipolygon.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipolygon.js +0 -158
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/point.d.ts +0 -14
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/point.js +0 -165
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/polygon.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/polygon.js +0 -207
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/types.d.ts +0 -30
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/types.js +0 -29
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wktparser.d.ts +0 -2
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wktparser.js +0 -111
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wkx.d.ts +0 -9
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wkx.js +0 -9
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/zigzag.d.ts +0 -5
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/zigzag.js +0 -9
- package/dist/powersync-sdk/sync-rules/DartSchemaGenerator.d.ts +0 -12
- package/dist/powersync-sdk/sync-rules/DartSchemaGenerator.js +0 -35
- package/dist/powersync-sdk/sync-rules/ExpressionType.d.ts +0 -33
- package/dist/powersync-sdk/sync-rules/ExpressionType.js +0 -62
- package/dist/powersync-sdk/sync-rules/IdSequence.d.ts +0 -4
- package/dist/powersync-sdk/sync-rules/IdSequence.js +0 -7
- package/dist/powersync-sdk/sync-rules/JsSchemaGenerator.d.ts +0 -12
- package/dist/powersync-sdk/sync-rules/JsSchemaGenerator.js +0 -38
- package/dist/powersync-sdk/sync-rules/SchemaGenerator.d.ts +0 -14
- package/dist/powersync-sdk/sync-rules/SchemaGenerator.js +0 -24
- package/dist/powersync-sdk/sync-rules/SourceTableInterface.d.ts +0 -5
- package/dist/powersync-sdk/sync-rules/SourceTableInterface.js +0 -1
- package/dist/powersync-sdk/sync-rules/SqlBucketDescriptor.d.ts +0 -37
- package/dist/powersync-sdk/sync-rules/SqlBucketDescriptor.js +0 -116
- package/dist/powersync-sdk/sync-rules/SqlDataQuery.d.ts +0 -39
- package/dist/powersync-sdk/sync-rules/SqlDataQuery.js +0 -245
- package/dist/powersync-sdk/sync-rules/SqlParameterQuery.d.ts +0 -43
- package/dist/powersync-sdk/sync-rules/SqlParameterQuery.js +0 -254
- package/dist/powersync-sdk/sync-rules/SqlSyncRules.d.ts +0 -52
- package/dist/powersync-sdk/sync-rules/SqlSyncRules.js +0 -252
- package/dist/powersync-sdk/sync-rules/StaticSchema.d.ts +0 -26
- package/dist/powersync-sdk/sync-rules/StaticSchema.js +0 -71
- package/dist/powersync-sdk/sync-rules/StaticSqlParameterQuery.d.ts +0 -24
- package/dist/powersync-sdk/sync-rules/StaticSqlParameterQuery.js +0 -71
- package/dist/powersync-sdk/sync-rules/TablePattern.d.ts +0 -17
- package/dist/powersync-sdk/sync-rules/TablePattern.js +0 -56
- package/dist/powersync-sdk/sync-rules/TableQuerySchema.d.ts +0 -9
- package/dist/powersync-sdk/sync-rules/TableQuerySchema.js +0 -41
- package/dist/powersync-sdk/sync-rules/errors.d.ts +0 -22
- package/dist/powersync-sdk/sync-rules/errors.js +0 -60
- package/dist/powersync-sdk/sync-rules/generators.d.ts +0 -6
- package/dist/powersync-sdk/sync-rules/generators.js +0 -6
- package/dist/powersync-sdk/sync-rules/index.d.ts +0 -17
- package/dist/powersync-sdk/sync-rules/index.js +0 -17
- package/dist/powersync-sdk/sync-rules/json_schema.d.ts +0 -3
- package/dist/powersync-sdk/sync-rules/json_schema.js +0 -50
- package/dist/powersync-sdk/sync-rules/sql_filters.d.ts +0 -91
- package/dist/powersync-sdk/sync-rules/sql_filters.js +0 -491
- package/dist/powersync-sdk/sync-rules/sql_functions.d.ts +0 -53
- package/dist/powersync-sdk/sync-rules/sql_functions.js +0 -755
- package/dist/powersync-sdk/sync-rules/sql_support.d.ts +0 -22
- package/dist/powersync-sdk/sync-rules/sql_support.js +0 -208
- package/dist/powersync-sdk/sync-rules/types.d.ts +0 -174
- package/dist/powersync-sdk/sync-rules/types.js +0 -9
- package/dist/powersync-sdk/sync-rules/utils.d.ts +0 -45
- package/dist/powersync-sdk/sync-rules/utils.js +0 -163
- package/dist/service/accounts.client.d.ts +0 -26
- package/dist/service/powersync.client.d.ts +0 -269
- package/dist/service/types.d.ts +0 -69
- package/dist/service/utils.d.ts +0 -5
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { createPaginatedEndpoint } from '../sdk-clients/pagination.js';
|
|
2
|
-
import { SDKClient } from '../sdk-clients/sdk-client.js';
|
|
3
|
-
import { ROUTES } from './routes.js';
|
|
4
|
-
export class AccountsV5Client extends SDKClient {
|
|
5
|
-
acceptInvite = this.createEndpoint({
|
|
6
|
-
path: ROUTES.ACCEPT_INVITE
|
|
7
|
-
});
|
|
8
|
-
completeSignup = this.createEndpoint({
|
|
9
|
-
path: ROUTES.COMPLETE_SIGNUP
|
|
10
|
-
});
|
|
11
|
-
createApp = this.createEndpoint({
|
|
12
|
-
path: ROUTES.CREATE_APP
|
|
13
|
-
});
|
|
14
|
-
createInvite = this.createEndpoint({
|
|
15
|
-
path: ROUTES.CREATE_DEV_INVITE
|
|
16
|
-
});
|
|
17
|
-
createOrg = this.createEndpoint({
|
|
18
|
-
path: ROUTES.CREATE_ORG
|
|
19
|
-
});
|
|
20
|
-
createUser = this.createEndpoint({
|
|
21
|
-
path: ROUTES.CREATE_USER
|
|
22
|
-
});
|
|
23
|
-
declineInvite = this.createEndpoint({
|
|
24
|
-
path: ROUTES.DECLINE_INVITE
|
|
25
|
-
});
|
|
26
|
-
deleteApp = this.createEndpoint({
|
|
27
|
-
path: ROUTES.DELETE_APP
|
|
28
|
-
});
|
|
29
|
-
deleteUser = this.createEndpoint({
|
|
30
|
-
path: ROUTES.DELETE_USER
|
|
31
|
-
});
|
|
32
|
-
destroyInvite = this.createEndpoint({
|
|
33
|
-
path: ROUTES.DESTROY_INVITE
|
|
34
|
-
});
|
|
35
|
-
downgradeOrg = this.createEndpoint({
|
|
36
|
-
path: ROUTES.DOWNGRADE_ORG
|
|
37
|
-
});
|
|
38
|
-
getApp = this.createEndpoint({
|
|
39
|
-
path: ROUTES.GET_APP
|
|
40
|
-
});
|
|
41
|
-
getOrg = this.createEndpoint({
|
|
42
|
-
path: ROUTES.GET_ORG
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* Get token for use with SensitiveProfileAccountsV5Client.
|
|
46
|
-
* Currently, this allows for managing MFA configurations.
|
|
47
|
-
*/
|
|
48
|
-
getSensitiveAccessToken = this.createEndpoint({
|
|
49
|
-
path: ROUTES.GET_SENSITIVE_ACCESS_TOKEN
|
|
50
|
-
});
|
|
51
|
-
getTrialUser = this.createEndpoint({
|
|
52
|
-
path: ROUTES.GET_TRIAL_USER
|
|
53
|
-
});
|
|
54
|
-
// === MUTATION ===
|
|
55
|
-
getUser = this.createEndpoint({
|
|
56
|
-
path: ROUTES.GET_USER
|
|
57
|
-
});
|
|
58
|
-
// === DEVELOPER INVITES ===
|
|
59
|
-
getUserInvites = createPaginatedEndpoint(this.createEndpoint({
|
|
60
|
-
path: ROUTES.GET_USER_INVITES
|
|
61
|
-
}));
|
|
62
|
-
getUserPreferredMFAFactor = this.createEndpoint({
|
|
63
|
-
path: ROUTES.GET_PREFERRED_FACTOR
|
|
64
|
-
});
|
|
65
|
-
/**
|
|
66
|
-
* @deprecated
|
|
67
|
-
*/
|
|
68
|
-
giveUserAccess = this.createEndpoint({
|
|
69
|
-
path: ROUTES.GIVE_USER_ACCESS
|
|
70
|
-
});
|
|
71
|
-
listApps = createPaginatedEndpoint(this.createEndpoint({
|
|
72
|
-
path: ROUTES.LIST_APPS
|
|
73
|
-
}));
|
|
74
|
-
listDeveloperInvites = createPaginatedEndpoint(this.createEndpoint({
|
|
75
|
-
path: ROUTES.LIST_DEV_INVITES
|
|
76
|
-
}));
|
|
77
|
-
// === TRIAL ===
|
|
78
|
-
listMFAFactors = this.createEndpoint({
|
|
79
|
-
path: ROUTES.LIST_MFA_FACTORS
|
|
80
|
-
});
|
|
81
|
-
listOrgs = createPaginatedEndpoint(this.createEndpoint({
|
|
82
|
-
path: ROUTES.LIST_ORGS
|
|
83
|
-
}));
|
|
84
|
-
listUsers = createPaginatedEndpoint(this.createEndpoint({
|
|
85
|
-
path: ROUTES.LIST_USERS
|
|
86
|
-
}));
|
|
87
|
-
provisionUserToken = this.createEndpoint({
|
|
88
|
-
path: ROUTES.PROVISION_USER_TOKEN
|
|
89
|
-
});
|
|
90
|
-
searchApps = createPaginatedEndpoint(this.createEndpoint({
|
|
91
|
-
path: ROUTES.SEARCH_APPS
|
|
92
|
-
}));
|
|
93
|
-
searchOrgs = createPaginatedEndpoint(this.createEndpoint({
|
|
94
|
-
path: ROUTES.SEARCH_ORGS
|
|
95
|
-
}));
|
|
96
|
-
searchUsers = createPaginatedEndpoint(this.createEndpoint({
|
|
97
|
-
path: ROUTES.SEARCH_USERS
|
|
98
|
-
}));
|
|
99
|
-
sendMFASMS = this.createEndpoint({
|
|
100
|
-
path: ROUTES.SEND_MFA_SMS
|
|
101
|
-
});
|
|
102
|
-
startTrial = this.createEndpoint({
|
|
103
|
-
path: ROUTES.START_TRIAL
|
|
104
|
-
});
|
|
105
|
-
updateApp = this.createEndpoint({
|
|
106
|
-
path: ROUTES.UPDATE_APP
|
|
107
|
-
});
|
|
108
|
-
updateInvite = this.createEndpoint({
|
|
109
|
-
path: ROUTES.UPDATE_INVITE
|
|
110
|
-
});
|
|
111
|
-
// === Security and MFA ===
|
|
112
|
-
updateOrg = this.createEndpoint({
|
|
113
|
-
path: ROUTES.UPDATE_ORG
|
|
114
|
-
});
|
|
115
|
-
updateOrgBilling = this.createEndpoint({
|
|
116
|
-
path: ROUTES.UPDATE_ORG_BILLING
|
|
117
|
-
});
|
|
118
|
-
updateUser = this.createEndpoint({
|
|
119
|
-
path: ROUTES.UPDATE_USER
|
|
120
|
-
});
|
|
121
|
-
upgradeOrg = this.createEndpoint({
|
|
122
|
-
path: ROUTES.UPGRADE_ORG
|
|
123
|
-
});
|
|
124
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import * as bson from 'bson';
|
|
3
|
-
import * as t from 'ts-codec';
|
|
4
|
-
export declare const buffer: t.Codec<Buffer, string, string, t.CodecProps>;
|
|
5
|
-
export declare const date: t.Codec<Date, string, string, t.CodecProps>;
|
|
6
|
-
export declare const ObjectId: t.Codec<bson.ObjectID, string, string, t.CodecProps>;
|
|
7
|
-
export declare const ResourceId: t.Codec<{
|
|
8
|
-
_id: bson.ObjectId;
|
|
9
|
-
}, {
|
|
10
|
-
id: string;
|
|
11
|
-
}, string, t.CodecProps>;
|
|
12
|
-
export declare const Timestamps: t.ObjectCodec<{
|
|
13
|
-
created_at: t.Codec<Date, string, string, t.CodecProps>;
|
|
14
|
-
updated_at: t.Codec<Date, string, string, t.CodecProps>;
|
|
15
|
-
}>;
|
|
16
|
-
export declare const Resource: t.Intersection<t.Codec<{
|
|
17
|
-
_id: bson.ObjectId;
|
|
18
|
-
}, {
|
|
19
|
-
id: string;
|
|
20
|
-
}, string, t.CodecProps>, t.ObjectCodec<{
|
|
21
|
-
created_at: t.Codec<Date, string, string, t.CodecProps>;
|
|
22
|
-
updated_at: t.Codec<Date, string, string, t.CodecProps>;
|
|
23
|
-
}>>;
|
|
24
|
-
export declare const QueryFilter: t.ObjectCodec<{
|
|
25
|
-
exists: t.IdentityCodec<t.CodecType.Boolean>;
|
|
26
|
-
}>;
|
|
27
|
-
export declare const makeQueryFilter: (type: t.AnyCodec) => t.OptionalCodec<t.Codec<any, any, string, t.CodecProps>>;
|
|
28
|
-
export declare const FilterProperties: <T extends t.AnyCodec>(type: T) => t.Codec<{ [K in keyof t.Encoded<T>]?: t.Ix<T>[K] | {
|
|
29
|
-
exists: boolean;
|
|
30
|
-
} | t.Ix<T>[K][] | undefined; }, { [K_1 in keyof t.Encoded<T>]?: {
|
|
31
|
-
exists: boolean;
|
|
32
|
-
} | t.Ox<T>[K_1] | t.Ox<T>[K_1][] | undefined; }, "FilterProperties", t.CodecProps>;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
/* eslint-disable unicorn/no-array-reduce */
|
|
3
|
-
/* eslint-disable unicorn/no-array-for-each */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
|
-
/* eslint-disable camelcase */
|
|
6
|
-
import * as bson from 'bson';
|
|
7
|
-
import * as t from 'ts-codec';
|
|
8
|
-
export const buffer = t.codec('Buffer', (buffer) => {
|
|
9
|
-
if (!Buffer.isBuffer(buffer)) {
|
|
10
|
-
throw new t.TransformError([`Expected buffer but got ${typeof buffer}`]);
|
|
11
|
-
}
|
|
12
|
-
return buffer.toString('base64');
|
|
13
|
-
}, (buffer) => Buffer.from(buffer, 'base64'));
|
|
14
|
-
export const date = t.codec('Date', (date) => {
|
|
15
|
-
if (!(date instanceof Date)) {
|
|
16
|
-
throw new t.TransformError([`Expected Date but got ${typeof date}`]);
|
|
17
|
-
}
|
|
18
|
-
return date.toISOString();
|
|
19
|
-
}, (date) => {
|
|
20
|
-
const parsed = new Date(date);
|
|
21
|
-
if (Number.isNaN(parsed.getTime())) {
|
|
22
|
-
throw new t.TransformError([`Invalid date`]);
|
|
23
|
-
}
|
|
24
|
-
return parsed;
|
|
25
|
-
});
|
|
26
|
-
const assertObjectId = (value) => {
|
|
27
|
-
if (!bson.ObjectId.isValid(value)) {
|
|
28
|
-
throw new t.TransformError([`Expected an ObjectId but got ${typeof value}`]);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
export const ObjectId = t.codec('ObjectId', (id) => {
|
|
32
|
-
assertObjectId(id);
|
|
33
|
-
return id.toHexString();
|
|
34
|
-
}, (id) => {
|
|
35
|
-
assertObjectId(id);
|
|
36
|
-
return new bson.ObjectId(id);
|
|
37
|
-
});
|
|
38
|
-
const assertObjectWithField = (field, data) => {
|
|
39
|
-
if (typeof data !== 'object') {
|
|
40
|
-
throw new t.TransformError([`Expected an object but got ${typeof data}`]);
|
|
41
|
-
}
|
|
42
|
-
if (!(field in data)) {
|
|
43
|
-
throw new t.TransformError([`Expected ${field} to be a member of object`]);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
export const ResourceId = t.codec('ResourceId', (data) => {
|
|
47
|
-
assertObjectWithField('_id', data);
|
|
48
|
-
return {
|
|
49
|
-
id: ObjectId.encode(data._id)
|
|
50
|
-
};
|
|
51
|
-
}, (data) => {
|
|
52
|
-
assertObjectWithField('id', data);
|
|
53
|
-
return {
|
|
54
|
-
_id: ObjectId.decode(data.id)
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
export const Timestamps = t.object({
|
|
58
|
-
created_at: date,
|
|
59
|
-
updated_at: date
|
|
60
|
-
});
|
|
61
|
-
export const Resource = ResourceId.and(Timestamps);
|
|
62
|
-
export const QueryFilter = t.object({
|
|
63
|
-
exists: t.boolean
|
|
64
|
-
});
|
|
65
|
-
export const makeQueryFilter = (type) => {
|
|
66
|
-
return type.or(t.array(type)).or(QueryFilter).optional();
|
|
67
|
-
};
|
|
68
|
-
export const FilterProperties = (type) => {
|
|
69
|
-
const codecs = new Map();
|
|
70
|
-
const addCodecs = (codec) => {
|
|
71
|
-
if (codec.props?.shape) {
|
|
72
|
-
for (const k of Object.keys(codec.props.shape)) {
|
|
73
|
-
codecs.set(k, codec.props.shape[k]);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
if (type._tag === t.CodecType.Object) {
|
|
78
|
-
addCodecs(type);
|
|
79
|
-
}
|
|
80
|
-
else if (type._tag === t.CodecType.Intersection) {
|
|
81
|
-
type.props.codecs.forEach((c) => {
|
|
82
|
-
addCodecs(c);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
t.object({
|
|
86
|
-
test: t.string
|
|
87
|
-
});
|
|
88
|
-
// @ts-ignore
|
|
89
|
-
return t.object([...codecs.keys()].reduce((prev, cur) => {
|
|
90
|
-
prev[cur] = makeQueryFilter(codecs.get(cur));
|
|
91
|
-
return prev;
|
|
92
|
-
}, {}));
|
|
93
|
-
};
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import * as t from 'ts-codec';
|
|
2
|
-
export declare enum BUSINESS_REGION {
|
|
3
|
-
US = "us",
|
|
4
|
-
ZA = "za"
|
|
5
|
-
}
|
|
6
|
-
export declare const Organization: t.ObjectCodec<{
|
|
7
|
-
business_customer_code: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
8
|
-
business_customer_region: t.OptionalCodec<t.Codec<BUSINESS_REGION, BUSINESS_REGION, string, t.CodecProps>>;
|
|
9
|
-
label: t.IdentityCodec<t.CodecType.String>;
|
|
10
|
-
locked: t.OptionalCodec<t.Codec<boolean, boolean, string, t.CodecProps>>;
|
|
11
|
-
pre_signup_trial_expiry: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
12
|
-
trial: t.OptionalCodec<t.Codec<boolean, boolean, string, t.CodecProps>>;
|
|
13
|
-
trial_expiry: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
14
|
-
}>;
|
|
15
|
-
export type Organization = t.Decoded<typeof Organization>;
|
|
16
|
-
export type SerializedOrganization = t.Encoded<typeof Organization>;
|
|
17
|
-
export declare const OrganizationResource: t.Intersection<t.Codec<{
|
|
18
|
-
label: string;
|
|
19
|
-
locked?: boolean | undefined;
|
|
20
|
-
business_customer_code?: string | undefined;
|
|
21
|
-
business_customer_region?: BUSINESS_REGION | undefined;
|
|
22
|
-
pre_signup_trial_expiry?: string | undefined;
|
|
23
|
-
trial?: boolean | undefined;
|
|
24
|
-
trial_expiry?: string | undefined;
|
|
25
|
-
}, {
|
|
26
|
-
label: string;
|
|
27
|
-
locked?: boolean | undefined;
|
|
28
|
-
business_customer_code?: string | undefined;
|
|
29
|
-
business_customer_region?: BUSINESS_REGION | undefined;
|
|
30
|
-
pre_signup_trial_expiry?: string | undefined;
|
|
31
|
-
trial?: boolean | undefined;
|
|
32
|
-
trial_expiry?: string | undefined;
|
|
33
|
-
}, string, t.CodecProps>, t.Codec<{
|
|
34
|
-
_id: import("bson").ObjectID;
|
|
35
|
-
}, {
|
|
36
|
-
id: string;
|
|
37
|
-
}, string, t.CodecProps>>;
|
|
38
|
-
export type OrganizationResource = t.Decoded<typeof OrganizationResource>;
|
|
39
|
-
export type SerializedOrganizationResource = t.Encoded<typeof OrganizationResource>;
|
|
40
|
-
export declare enum VCS_MODE {
|
|
41
|
-
ADVANCED = "ADVANCED",
|
|
42
|
-
BASIC = "BASIC"
|
|
43
|
-
}
|
|
44
|
-
export declare enum ProjectFeatureFlags {
|
|
45
|
-
APP = "app",
|
|
46
|
-
POWERSYNC = "powersync"
|
|
47
|
-
}
|
|
48
|
-
export declare const App: t.ObjectCodec<{
|
|
49
|
-
auth_scope_id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
50
|
-
features: t.ArrayCodec<t.EnumCodec<typeof ProjectFeatureFlags>>;
|
|
51
|
-
name: t.IdentityCodec<t.CodecType.String>;
|
|
52
|
-
org_id: t.IdentityCodec<t.CodecType.String>;
|
|
53
|
-
region: t.IdentityCodec<t.CodecType.String>;
|
|
54
|
-
source: t.OptionalCodec<t.Codec<{
|
|
55
|
-
type: import("./source.js").SourceType.GitHub;
|
|
56
|
-
properties: {
|
|
57
|
-
repo: string;
|
|
58
|
-
owner: string;
|
|
59
|
-
};
|
|
60
|
-
} | {
|
|
61
|
-
type: import("./source.js").SourceType.Internal;
|
|
62
|
-
properties: {
|
|
63
|
-
id: string;
|
|
64
|
-
};
|
|
65
|
-
} | {
|
|
66
|
-
type: import("./source.js").SourceType.AzureDevops;
|
|
67
|
-
properties: {
|
|
68
|
-
repo: string;
|
|
69
|
-
organization: string;
|
|
70
|
-
project: string;
|
|
71
|
-
};
|
|
72
|
-
}, {
|
|
73
|
-
type: import("./source.js").SourceType.GitHub;
|
|
74
|
-
properties: {
|
|
75
|
-
repo: string;
|
|
76
|
-
owner: string;
|
|
77
|
-
};
|
|
78
|
-
} | {
|
|
79
|
-
type: import("./source.js").SourceType.Internal;
|
|
80
|
-
properties: {
|
|
81
|
-
id: string;
|
|
82
|
-
};
|
|
83
|
-
} | {
|
|
84
|
-
type: import("./source.js").SourceType.AzureDevops;
|
|
85
|
-
properties: {
|
|
86
|
-
repo: string;
|
|
87
|
-
organization: string;
|
|
88
|
-
project: string;
|
|
89
|
-
};
|
|
90
|
-
}, string, t.CodecProps>>;
|
|
91
|
-
vcs_mode: t.OptionalCodec<t.Codec<VCS_MODE, VCS_MODE, string, t.CodecProps>>;
|
|
92
|
-
}>;
|
|
93
|
-
export type App = t.Decoded<typeof App>;
|
|
94
|
-
export type SerializedApp = t.Encoded<typeof App>;
|
|
95
|
-
export declare const AppResource: t.Intersection<t.Codec<{
|
|
96
|
-
name: string;
|
|
97
|
-
region: string;
|
|
98
|
-
org_id: string;
|
|
99
|
-
features: ProjectFeatureFlags[];
|
|
100
|
-
source?: {
|
|
101
|
-
type: import("./source.js").SourceType.GitHub;
|
|
102
|
-
properties: {
|
|
103
|
-
repo: string;
|
|
104
|
-
owner: string;
|
|
105
|
-
};
|
|
106
|
-
} | {
|
|
107
|
-
type: import("./source.js").SourceType.Internal;
|
|
108
|
-
properties: {
|
|
109
|
-
id: string;
|
|
110
|
-
};
|
|
111
|
-
} | {
|
|
112
|
-
type: import("./source.js").SourceType.AzureDevops;
|
|
113
|
-
properties: {
|
|
114
|
-
repo: string;
|
|
115
|
-
organization: string;
|
|
116
|
-
project: string;
|
|
117
|
-
};
|
|
118
|
-
} | undefined;
|
|
119
|
-
auth_scope_id?: string | undefined;
|
|
120
|
-
vcs_mode?: VCS_MODE | undefined;
|
|
121
|
-
}, {
|
|
122
|
-
name: string;
|
|
123
|
-
region: string;
|
|
124
|
-
org_id: string;
|
|
125
|
-
features: ProjectFeatureFlags[];
|
|
126
|
-
source?: {
|
|
127
|
-
type: import("./source.js").SourceType.GitHub;
|
|
128
|
-
properties: {
|
|
129
|
-
repo: string;
|
|
130
|
-
owner: string;
|
|
131
|
-
};
|
|
132
|
-
} | {
|
|
133
|
-
type: import("./source.js").SourceType.Internal;
|
|
134
|
-
properties: {
|
|
135
|
-
id: string;
|
|
136
|
-
};
|
|
137
|
-
} | {
|
|
138
|
-
type: import("./source.js").SourceType.AzureDevops;
|
|
139
|
-
properties: {
|
|
140
|
-
repo: string;
|
|
141
|
-
organization: string;
|
|
142
|
-
project: string;
|
|
143
|
-
};
|
|
144
|
-
} | undefined;
|
|
145
|
-
auth_scope_id?: string | undefined;
|
|
146
|
-
vcs_mode?: VCS_MODE | undefined;
|
|
147
|
-
}, string, t.CodecProps>, t.Codec<{
|
|
148
|
-
_id: import("bson").ObjectID;
|
|
149
|
-
}, {
|
|
150
|
-
id: string;
|
|
151
|
-
}, string, t.CodecProps>>;
|
|
152
|
-
export type AppResource = t.Decoded<typeof AppResource>;
|
|
153
|
-
export type SerializedAppResource = t.Encoded<typeof AppResource>;
|
|
154
|
-
export declare enum UserOrgAccess {
|
|
155
|
-
DEVELOPER = "developer",
|
|
156
|
-
OWNER = "owner"
|
|
157
|
-
}
|
|
158
|
-
export declare const User: t.ObjectCodec<{
|
|
159
|
-
email: t.IdentityCodec<t.CodecType.String>;
|
|
160
|
-
name: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
161
|
-
onboarding_token: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
162
|
-
org_id: t.IdentityCodec<t.CodecType.String>;
|
|
163
|
-
phone_number: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
164
|
-
signup_complete: t.OptionalCodec<t.Codec<boolean, boolean, string, t.CodecProps>>;
|
|
165
|
-
}>;
|
|
166
|
-
export type User = t.Decoded<typeof User>;
|
|
167
|
-
export type SerializedUser = t.Encoded<typeof User>;
|
|
168
|
-
export declare const UserResource: t.Intersection<t.Codec<{
|
|
169
|
-
org_id: string;
|
|
170
|
-
email: string;
|
|
171
|
-
name?: string | undefined;
|
|
172
|
-
phone_number?: string | undefined;
|
|
173
|
-
onboarding_token?: string | undefined;
|
|
174
|
-
signup_complete?: boolean | undefined;
|
|
175
|
-
}, {
|
|
176
|
-
org_id: string;
|
|
177
|
-
email: string;
|
|
178
|
-
name?: string | undefined;
|
|
179
|
-
phone_number?: string | undefined;
|
|
180
|
-
onboarding_token?: string | undefined;
|
|
181
|
-
signup_complete?: boolean | undefined;
|
|
182
|
-
}, string, t.CodecProps>, t.Codec<{
|
|
183
|
-
_id: import("bson").ObjectID;
|
|
184
|
-
}, {
|
|
185
|
-
id: string;
|
|
186
|
-
}, string, t.CodecProps>>;
|
|
187
|
-
export type UserResource = t.Decoded<typeof UserResource>;
|
|
188
|
-
export type SerializedUserResource = t.Encoded<typeof UserResource>;
|
|
189
|
-
export declare enum DeveloperInviteStatus {
|
|
190
|
-
ACCEPTED = "accepted",
|
|
191
|
-
DECLINED = "declined",
|
|
192
|
-
PENDING = "pending"
|
|
193
|
-
}
|
|
194
|
-
export declare const DeveloperInvite: t.ObjectCodec<{
|
|
195
|
-
metadata: t.ObjectCodec<{
|
|
196
|
-
email: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
197
|
-
org_name: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
198
|
-
role_names: t.OptionalCodec<t.Codec<string[], string[], string, t.CodecProps>>;
|
|
199
|
-
user_name: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
200
|
-
}>;
|
|
201
|
-
org_id: t.IdentityCodec<t.CodecType.String>;
|
|
202
|
-
requested_role_ids: t.ArrayCodec<t.IdentityCodec<t.CodecType.String>>;
|
|
203
|
-
responded_at: t.IdentityCodec<t.CodecType.String>;
|
|
204
|
-
status: t.EnumCodec<typeof DeveloperInviteStatus>;
|
|
205
|
-
user_id: t.IdentityCodec<t.CodecType.String>;
|
|
206
|
-
}>;
|
|
207
|
-
export type DeveloperInvite = t.Decoded<typeof DeveloperInvite>;
|
|
208
|
-
export type SerializedDeveloperInvite = t.Encoded<typeof DeveloperInvite>;
|
|
209
|
-
export declare const DeveloperInviteResource: t.Intersection<t.Codec<{
|
|
210
|
-
metadata: {
|
|
211
|
-
email?: string | undefined;
|
|
212
|
-
role_names?: string[] | undefined;
|
|
213
|
-
org_name?: string | undefined;
|
|
214
|
-
user_name?: string | undefined;
|
|
215
|
-
};
|
|
216
|
-
org_id: string;
|
|
217
|
-
status: DeveloperInviteStatus;
|
|
218
|
-
requested_role_ids: string[];
|
|
219
|
-
responded_at: string;
|
|
220
|
-
user_id: string;
|
|
221
|
-
}, {
|
|
222
|
-
metadata: {
|
|
223
|
-
email?: string | undefined;
|
|
224
|
-
role_names?: string[] | undefined;
|
|
225
|
-
org_name?: string | undefined;
|
|
226
|
-
user_name?: string | undefined;
|
|
227
|
-
};
|
|
228
|
-
org_id: string;
|
|
229
|
-
status: DeveloperInviteStatus;
|
|
230
|
-
requested_role_ids: string[];
|
|
231
|
-
responded_at: string;
|
|
232
|
-
user_id: string;
|
|
233
|
-
}, string, t.CodecProps>, t.Codec<{
|
|
234
|
-
_id: import("bson").ObjectID;
|
|
235
|
-
}, {
|
|
236
|
-
id: string;
|
|
237
|
-
}, string, t.CodecProps>>;
|
|
238
|
-
export type DeveloperInviteResource = t.Decoded<typeof DeveloperInviteResource>;
|
|
239
|
-
export type SerializedDeveloperInviteResource = t.Encoded<typeof DeveloperInviteResource>;
|
|
240
|
-
export declare enum MFAFactorState {
|
|
241
|
-
ACTIVE = "active",
|
|
242
|
-
DISABLED = "disabled",
|
|
243
|
-
PENDING = "pending"
|
|
244
|
-
}
|
|
245
|
-
export declare enum MFAFactor {
|
|
246
|
-
SMS = "sms",
|
|
247
|
-
TOTP = "totp"
|
|
248
|
-
}
|
|
249
|
-
export declare const UserMFAFactorResource: t.ObjectCodec<{
|
|
250
|
-
created_at: t.IdentityCodec<t.CodecType.String>;
|
|
251
|
-
deleted_at: t.IdentityCodec<t.CodecType.String>;
|
|
252
|
-
factor_type: t.EnumCodec<typeof MFAFactor>;
|
|
253
|
-
id: t.IdentityCodec<t.CodecType.String>;
|
|
254
|
-
sms_otp_mobile_number: t.IdentityCodec<t.CodecType.String>;
|
|
255
|
-
state: t.EnumCodec<typeof MFAFactorState>;
|
|
256
|
-
totp_factor_sid: t.IdentityCodec<t.CodecType.String>;
|
|
257
|
-
updated_at: t.IdentityCodec<t.CodecType.String>;
|
|
258
|
-
}>;
|
|
259
|
-
export type UserMFAFactorResource = t.Decoded<typeof UserMFAFactorResource>;
|
|
260
|
-
export type SerializedUserMFAFactorResource = t.Encoded<typeof UserMFAFactorResource>;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/* eslint-disable new-cap */
|
|
2
|
-
/* eslint-disable camelcase */
|
|
3
|
-
import * as t from 'ts-codec';
|
|
4
|
-
import * as codecs from './codecs.js';
|
|
5
|
-
import { SourceMetadata } from './source.js';
|
|
6
|
-
export var BUSINESS_REGION;
|
|
7
|
-
(function (BUSINESS_REGION) {
|
|
8
|
-
BUSINESS_REGION["US"] = "us";
|
|
9
|
-
BUSINESS_REGION["ZA"] = "za";
|
|
10
|
-
})(BUSINESS_REGION || (BUSINESS_REGION = {}));
|
|
11
|
-
export const Organization = t.object({
|
|
12
|
-
business_customer_code: t.string.optional(),
|
|
13
|
-
business_customer_region: t.Enum(BUSINESS_REGION).optional(),
|
|
14
|
-
label: t.string,
|
|
15
|
-
locked: t.boolean.optional(),
|
|
16
|
-
pre_signup_trial_expiry: t.string.optional(),
|
|
17
|
-
trial: t.boolean.optional(),
|
|
18
|
-
trial_expiry: t.string.optional()
|
|
19
|
-
});
|
|
20
|
-
export const OrganizationResource = Organization.and(codecs.ResourceId);
|
|
21
|
-
export var VCS_MODE;
|
|
22
|
-
(function (VCS_MODE) {
|
|
23
|
-
VCS_MODE["ADVANCED"] = "ADVANCED";
|
|
24
|
-
VCS_MODE["BASIC"] = "BASIC";
|
|
25
|
-
})(VCS_MODE || (VCS_MODE = {}));
|
|
26
|
-
export var ProjectFeatureFlags;
|
|
27
|
-
(function (ProjectFeatureFlags) {
|
|
28
|
-
ProjectFeatureFlags["APP"] = "app";
|
|
29
|
-
ProjectFeatureFlags["POWERSYNC"] = "powersync";
|
|
30
|
-
// maybe later: 'cloudcode', 'backend'
|
|
31
|
-
})(ProjectFeatureFlags || (ProjectFeatureFlags = {}));
|
|
32
|
-
export const App = t.object({
|
|
33
|
-
auth_scope_id: t.string.optional(),
|
|
34
|
-
features: t.array(t.Enum(ProjectFeatureFlags)),
|
|
35
|
-
name: t.string,
|
|
36
|
-
org_id: t.string,
|
|
37
|
-
region: t.string,
|
|
38
|
-
source: SourceMetadata.optional(),
|
|
39
|
-
vcs_mode: t.Enum(VCS_MODE).optional()
|
|
40
|
-
});
|
|
41
|
-
export const AppResource = App.and(codecs.ResourceId);
|
|
42
|
-
export var UserOrgAccess;
|
|
43
|
-
(function (UserOrgAccess) {
|
|
44
|
-
UserOrgAccess["DEVELOPER"] = "developer";
|
|
45
|
-
UserOrgAccess["OWNER"] = "owner";
|
|
46
|
-
})(UserOrgAccess || (UserOrgAccess = {}));
|
|
47
|
-
export const User = t.object({
|
|
48
|
-
email: t.string,
|
|
49
|
-
name: t.string.optional(),
|
|
50
|
-
onboarding_token: t.string.optional(),
|
|
51
|
-
org_id: t.string,
|
|
52
|
-
phone_number: t.string.optional(),
|
|
53
|
-
signup_complete: t.boolean.optional()
|
|
54
|
-
});
|
|
55
|
-
export const UserResource = User.and(codecs.ResourceId);
|
|
56
|
-
export var DeveloperInviteStatus;
|
|
57
|
-
(function (DeveloperInviteStatus) {
|
|
58
|
-
DeveloperInviteStatus["ACCEPTED"] = "accepted";
|
|
59
|
-
DeveloperInviteStatus["DECLINED"] = "declined";
|
|
60
|
-
DeveloperInviteStatus["PENDING"] = "pending";
|
|
61
|
-
})(DeveloperInviteStatus || (DeveloperInviteStatus = {}));
|
|
62
|
-
export const DeveloperInvite = t.object({
|
|
63
|
-
metadata: t.object({
|
|
64
|
-
email: t.string.optional(),
|
|
65
|
-
org_name: t.string.optional(),
|
|
66
|
-
role_names: t.array(t.string).optional(),
|
|
67
|
-
user_name: t.string.optional()
|
|
68
|
-
}),
|
|
69
|
-
org_id: t.string,
|
|
70
|
-
requested_role_ids: t.array(t.string),
|
|
71
|
-
responded_at: t.string,
|
|
72
|
-
status: t.Enum(DeveloperInviteStatus),
|
|
73
|
-
user_id: t.string
|
|
74
|
-
});
|
|
75
|
-
export const DeveloperInviteResource = DeveloperInvite.and(codecs.ResourceId);
|
|
76
|
-
export var MFAFactorState;
|
|
77
|
-
(function (MFAFactorState) {
|
|
78
|
-
MFAFactorState["ACTIVE"] = "active";
|
|
79
|
-
MFAFactorState["DISABLED"] = "disabled";
|
|
80
|
-
MFAFactorState["PENDING"] = "pending";
|
|
81
|
-
})(MFAFactorState || (MFAFactorState = {}));
|
|
82
|
-
export var MFAFactor;
|
|
83
|
-
(function (MFAFactor) {
|
|
84
|
-
MFAFactor["SMS"] = "sms";
|
|
85
|
-
MFAFactor["TOTP"] = "totp";
|
|
86
|
-
})(MFAFactor || (MFAFactor = {}));
|
|
87
|
-
export const UserMFAFactorResource = t.object({
|
|
88
|
-
created_at: t.string,
|
|
89
|
-
deleted_at: t.string,
|
|
90
|
-
factor_type: t.Enum(MFAFactor),
|
|
91
|
-
id: t.string,
|
|
92
|
-
sms_otp_mobile_number: t.string,
|
|
93
|
-
state: t.Enum(MFAFactorState),
|
|
94
|
-
totp_factor_sid: t.string,
|
|
95
|
-
updated_at: t.string
|
|
96
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export declare enum ROUTES {
|
|
2
|
-
ACCEPT_INVITE = "/api/accounts/v5/invites/accept",
|
|
3
|
-
COMPLETE_SIGNUP = "/api/accounts/v5/trial/complete-signup",
|
|
4
|
-
CREATE_APP = "/api/accounts/v5/apps/create",
|
|
5
|
-
CREATE_DEV_INVITE = "/api/accounts/v5/invites/create",
|
|
6
|
-
CREATE_ORG = "/api/accounts/v5/organizations/create",
|
|
7
|
-
CREATE_USER = "/api/accounts/v5/users/create",
|
|
8
|
-
DECLINE_INVITE = "/api/accounts/v5/invites/decline",
|
|
9
|
-
DELETE_APP = "/api/accounts/v5/apps/delete",
|
|
10
|
-
DELETE_MFA_FACTOR = "/me/profile/delete_factor",
|
|
11
|
-
DELETE_USER = "/api/accounts/v5/users/delete",
|
|
12
|
-
DESTROY_INVITE = "/api/accounts/v5/invites/destroy",
|
|
13
|
-
DOWNGRADE_ORG = "/api/accounts/v5/organizations/downgrade",
|
|
14
|
-
GENERATE_MFA_BACKUP_CODES = "/me/profile/generate_backup_codes",
|
|
15
|
-
GET_APP = "/api/accounts/v5/apps/get",
|
|
16
|
-
GET_ORG = "/api/accounts/v5/organizations/get",
|
|
17
|
-
GET_PREFERRED_FACTOR = "/me/profile/get_preferred_factor",
|
|
18
|
-
GET_SENSITIVE_ACCESS_TOKEN = "/me/profile/auth_for_token",
|
|
19
|
-
GET_TRIAL_USER = "/api/accounts/v5/trial/get-user",
|
|
20
|
-
GET_USER = "/api/accounts/v5/users/get",
|
|
21
|
-
GET_USER_INVITES = "/api/accounts/v5/invites/user-invites",
|
|
22
|
-
GIVE_USER_ACCESS = "/api/accounts/v5/organizations/give-user-access",
|
|
23
|
-
LIST_APPS = "/api/accounts/v5/apps/list",
|
|
24
|
-
LIST_DEV_INVITES = "/api/accounts/v5/invites/list",
|
|
25
|
-
LIST_MFA_FACTORS = "/me/profile/list_mfa_factors",
|
|
26
|
-
LIST_ORGS = "/api/accounts/v5/organizations/list",
|
|
27
|
-
LIST_USERS = "/api/accounts/v5/users/list",
|
|
28
|
-
PROVISION_USER_TOKEN = "/api/accounts/v5/trial/provision-user-token",
|
|
29
|
-
REGISTER_SMS_USER_MFA_FACTOR = "/me/profile/register_sms_factor",
|
|
30
|
-
REGISTER_TOTP_USER_MFA_FACTOR = "/me/profile/register_totp_factor",
|
|
31
|
-
SEARCH_APPS = "/api/accounts/v5/apps/search",
|
|
32
|
-
SEARCH_ORGS = "/api/accounts/v5/organizations/search",
|
|
33
|
-
SEARCH_USERS = "/api/accounts/v5/users/search",
|
|
34
|
-
SEND_MFA_SMS = "/me/profile/request_otp_sms",
|
|
35
|
-
SET_PREFERRED_MFA_METHOD = "/me/profile/set_preferred_factor",
|
|
36
|
-
START_TRIAL = "/api/accounts/v5/trial/start",
|
|
37
|
-
UPDATE_APP = "/api/accounts/v5/apps/update",
|
|
38
|
-
UPDATE_INVITE = "/api/accounts/v5/invites/update",
|
|
39
|
-
UPDATE_ORG = "/api/accounts/v5/organizations/update",
|
|
40
|
-
UPDATE_ORG_BILLING = "/api/accounts/v5/organizations/update-billing",
|
|
41
|
-
UPDATE_USER = "/api/accounts/v5/users/update",
|
|
42
|
-
UPGRADE_ORG = "/api/accounts/v5/organizations/upgrade",
|
|
43
|
-
VERIFY_MFA_FACTOR = "/me/profile/verify_factor"
|
|
44
|
-
}
|