@nevermined-io/commons 0.0.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/README.md +7 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/lib/constants/AssetConstants.d.ts +4 -0
- package/dist/lib/constants/AssetConstants.d.ts.map +1 -0
- package/dist/lib/constants/AssetConstants.js +3 -0
- package/dist/lib/constants/index.d.ts +3 -0
- package/dist/lib/constants/index.d.ts.map +1 -0
- package/dist/lib/constants/index.js +1 -0
- package/dist/lib/ddo/DDO.d.ts +40 -0
- package/dist/lib/ddo/DDO.d.ts.map +1 -0
- package/dist/lib/ddo/DDO.js +97 -0
- package/dist/lib/ddo/index.d.ts +2 -0
- package/dist/lib/ddo/index.d.ts.map +1 -0
- package/dist/lib/ddo/index.js +1 -0
- package/dist/lib/types/ApiResponseTypes.d.ts +46 -0
- package/dist/lib/types/ApiResponseTypes.d.ts.map +1 -0
- package/dist/lib/types/ApiResponseTypes.js +39 -0
- package/dist/lib/types/ContractsTypes.d.ts +90 -0
- package/dist/lib/types/ContractsTypes.d.ts.map +1 -0
- package/dist/lib/types/ContractsTypes.js +26 -0
- package/dist/lib/types/DDOTypes.d.ts +134 -0
- package/dist/lib/types/DDOTypes.d.ts.map +1 -0
- package/dist/lib/types/DDOTypes.js +14 -0
- package/dist/lib/types/GeneralTypes.d.ts +28 -0
- package/dist/lib/types/GeneralTypes.d.ts.map +1 -0
- package/dist/lib/types/GeneralTypes.js +1 -0
- package/dist/lib/types/MetadataTypes.d.ts +130 -0
- package/dist/lib/types/MetadataTypes.d.ts.map +1 -0
- package/dist/lib/types/MetadataTypes.js +62 -0
- package/dist/lib/types/OrganizationResponseTypes.d.ts +150 -0
- package/dist/lib/types/OrganizationResponseTypes.d.ts.map +1 -0
- package/dist/lib/types/OrganizationResponseTypes.js +124 -0
- package/dist/lib/types/TranscoderTypes.d.ts +28 -0
- package/dist/lib/types/TranscoderTypes.d.ts.map +1 -0
- package/dist/lib/types/TranscoderTypes.js +30 -0
- package/dist/lib/types/index.d.ts +7 -0
- package/dist/lib/types/index.d.ts.map +1 -0
- package/dist/lib/types/index.js +6 -0
- package/dist/lib/types/types.d.ts +228 -0
- package/dist/lib/types/types.d.ts.map +1 -0
- package/dist/lib/types/types.js +152 -0
- package/package.json +22 -0
- package/src/index.ts +4 -0
- package/src/lib/constants/AssetConstants.ts +7 -0
- package/src/lib/constants/index.ts +2 -0
- package/src/lib/ddo/DDO.ts +121 -0
- package/src/lib/ddo/index.ts +1 -0
- package/src/lib/types/ContractsTypes.ts +113 -0
- package/src/lib/types/DDOTypes.ts +149 -0
- package/src/lib/types/GeneralTypes.ts +31 -0
- package/src/lib/types/MetadataTypes.ts +145 -0
- package/src/lib/types/TranscoderTypes.ts +29 -0
- package/src/lib/types/index.ts +6 -0
- package/src/lib/types/types.ts +264 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { DDO } from '../ddo/DDO.js';
|
|
2
|
+
/**
|
|
3
|
+
* It described the policy to be used when resolving an asset. It has the following options:
|
|
4
|
+
* * ImmutableFirst - It checks if there is a reference to an immutable data-store (IPFS, Filecoin, etc) on-chain. If that's the case uses the URL to resolve the Metadata. If not try to resolve the metadata using the URL of the Metadata/Marketplace API
|
|
5
|
+
* * MetadataAPIFirst - Try to resolve the metadata from the Marketplace/Metadata API, if it can't tries to resolve using the immutable url
|
|
6
|
+
* * OnlyImmutable - Try to resolve the metadata only from the immutable data store URL
|
|
7
|
+
* * OnlyMetadataAPI - Try to resolve the metadata only from the Metadata API. It gets the metadata api url from the DIDRegistry
|
|
8
|
+
* * NoRegisry - Gets the metadata from the Metadata API using as endpoint the metadata api url from the SDK config. This method don't gets any on-chain information because assumes the DID is not registered on-chain
|
|
9
|
+
*/
|
|
10
|
+
export declare enum DIDResolvePolicy {
|
|
11
|
+
ImmutableFirst = 0,
|
|
12
|
+
MetadataAPIFirst = 1,
|
|
13
|
+
OnlyImmutable = 2,
|
|
14
|
+
OnlyMetadataAPI = 3,
|
|
15
|
+
NoRegistry = 4
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Where the metadata will be published. Options:
|
|
19
|
+
* - OnlyMetadataAPI, The metadata will be stored only in the Metadata/Marketplace API
|
|
20
|
+
* - IPFS, The metadata will be stored in the Metadata/Marketplace API and IPFS
|
|
21
|
+
* - Filecoin, The metadata will be stored in the Metadata/Marketplace API and Filecoin
|
|
22
|
+
* - Arweave, The metadata will be stored in the Metadata/Marketplace API and Arweave
|
|
23
|
+
*/
|
|
24
|
+
export declare enum PublishMetadataOptions {
|
|
25
|
+
OnlyMetadataAPI = 0,
|
|
26
|
+
IPFS = 1,
|
|
27
|
+
Filecoin = 2,
|
|
28
|
+
Arweave = 3
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* It specifies if the DID will be published on-chain initially or not.
|
|
32
|
+
*/
|
|
33
|
+
export declare enum PublishOnChainOptions {
|
|
34
|
+
DIDRegistry = 0,// The DID and the reference to the DDO will be stored in the DIDRegistry contract
|
|
35
|
+
OnlyOffchain = 1
|
|
36
|
+
}
|
|
37
|
+
export declare class AssetPublicationOptions {
|
|
38
|
+
metadata?: PublishMetadataOptions;
|
|
39
|
+
did?: PublishOnChainOptions;
|
|
40
|
+
}
|
|
41
|
+
export interface SearchResults {
|
|
42
|
+
value: number;
|
|
43
|
+
relation: 'eq' | 'gte';
|
|
44
|
+
}
|
|
45
|
+
export interface QueryResult {
|
|
46
|
+
results: DDO[];
|
|
47
|
+
page: number;
|
|
48
|
+
totalPages: number;
|
|
49
|
+
totalResults: {
|
|
50
|
+
[jsonPath: string]: any;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface MarketplaceResults<Entity> {
|
|
54
|
+
page: number;
|
|
55
|
+
results: Entity[];
|
|
56
|
+
total_pages: number;
|
|
57
|
+
total_results: SearchResults;
|
|
58
|
+
}
|
|
59
|
+
export interface SearchQuery {
|
|
60
|
+
offset?: number;
|
|
61
|
+
page?: number;
|
|
62
|
+
text?: string;
|
|
63
|
+
query?: unknown;
|
|
64
|
+
sort?: unknown;
|
|
65
|
+
show_unlisted?: boolean;
|
|
66
|
+
appId?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare enum PermissionType {
|
|
69
|
+
Read = "read",
|
|
70
|
+
Update = "update",
|
|
71
|
+
Delete = "delete",
|
|
72
|
+
Admin = "admin"
|
|
73
|
+
}
|
|
74
|
+
export interface NewPermission {
|
|
75
|
+
userId: string;
|
|
76
|
+
type: PermissionType[];
|
|
77
|
+
issuer: string;
|
|
78
|
+
holder: string;
|
|
79
|
+
}
|
|
80
|
+
export interface Permission extends NewPermission {
|
|
81
|
+
id: string;
|
|
82
|
+
issuanceDate: Date;
|
|
83
|
+
}
|
|
84
|
+
export declare enum PaymentMethodsAccepted {
|
|
85
|
+
Crypto = "crypto",
|
|
86
|
+
Fiat = "fiat",
|
|
87
|
+
All = "all",
|
|
88
|
+
NotSelected = "notSelected"
|
|
89
|
+
}
|
|
90
|
+
export declare enum State {
|
|
91
|
+
Disabled = "disabled",
|
|
92
|
+
Unconfirmed = "unconfirmed",
|
|
93
|
+
Confirmed = "confirmed"
|
|
94
|
+
}
|
|
95
|
+
export interface Stripe {
|
|
96
|
+
accountId?: string | null;
|
|
97
|
+
isAccountValidated?: boolean;
|
|
98
|
+
accountCreatedAt?: string;
|
|
99
|
+
accountUpdatedAt?: string;
|
|
100
|
+
additionalInformation?: unknown;
|
|
101
|
+
}
|
|
102
|
+
export interface AdditionalInformation {
|
|
103
|
+
privyUserId?: string;
|
|
104
|
+
privyWalletId?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface NewProfile {
|
|
107
|
+
isListed: boolean;
|
|
108
|
+
state: State;
|
|
109
|
+
addresses: string[];
|
|
110
|
+
nickname: string;
|
|
111
|
+
name?: string;
|
|
112
|
+
email?: string;
|
|
113
|
+
live?: Stripe;
|
|
114
|
+
sandbox?: Stripe;
|
|
115
|
+
paymentCountry?: string;
|
|
116
|
+
additionalInformation?: unknown;
|
|
117
|
+
}
|
|
118
|
+
export interface Profile extends NewProfile {
|
|
119
|
+
userId: string;
|
|
120
|
+
creationDate: Date;
|
|
121
|
+
updateDate: Date;
|
|
122
|
+
}
|
|
123
|
+
export interface ReducedProfile {
|
|
124
|
+
userId: string;
|
|
125
|
+
nickname?: string;
|
|
126
|
+
live?: Stripe;
|
|
127
|
+
sandbox?: Stripe;
|
|
128
|
+
additionalInformation?: unknown;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=MetadataTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetadataTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/types/MetadataTypes.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* It described the policy to be used when resolving an asset. It has the following options:
|
|
3
|
+
* * ImmutableFirst - It checks if there is a reference to an immutable data-store (IPFS, Filecoin, etc) on-chain. If that's the case uses the URL to resolve the Metadata. If not try to resolve the metadata using the URL of the Metadata/Marketplace API
|
|
4
|
+
* * MetadataAPIFirst - Try to resolve the metadata from the Marketplace/Metadata API, if it can't tries to resolve using the immutable url
|
|
5
|
+
* * OnlyImmutable - Try to resolve the metadata only from the immutable data store URL
|
|
6
|
+
* * OnlyMetadataAPI - Try to resolve the metadata only from the Metadata API. It gets the metadata api url from the DIDRegistry
|
|
7
|
+
* * NoRegisry - Gets the metadata from the Metadata API using as endpoint the metadata api url from the SDK config. This method don't gets any on-chain information because assumes the DID is not registered on-chain
|
|
8
|
+
*/
|
|
9
|
+
export var DIDResolvePolicy;
|
|
10
|
+
(function (DIDResolvePolicy) {
|
|
11
|
+
DIDResolvePolicy[DIDResolvePolicy["ImmutableFirst"] = 0] = "ImmutableFirst";
|
|
12
|
+
DIDResolvePolicy[DIDResolvePolicy["MetadataAPIFirst"] = 1] = "MetadataAPIFirst";
|
|
13
|
+
DIDResolvePolicy[DIDResolvePolicy["OnlyImmutable"] = 2] = "OnlyImmutable";
|
|
14
|
+
DIDResolvePolicy[DIDResolvePolicy["OnlyMetadataAPI"] = 3] = "OnlyMetadataAPI";
|
|
15
|
+
DIDResolvePolicy[DIDResolvePolicy["NoRegistry"] = 4] = "NoRegistry";
|
|
16
|
+
})(DIDResolvePolicy || (DIDResolvePolicy = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Where the metadata will be published. Options:
|
|
19
|
+
* - OnlyMetadataAPI, The metadata will be stored only in the Metadata/Marketplace API
|
|
20
|
+
* - IPFS, The metadata will be stored in the Metadata/Marketplace API and IPFS
|
|
21
|
+
* - Filecoin, The metadata will be stored in the Metadata/Marketplace API and Filecoin
|
|
22
|
+
* - Arweave, The metadata will be stored in the Metadata/Marketplace API and Arweave
|
|
23
|
+
*/
|
|
24
|
+
export var PublishMetadataOptions;
|
|
25
|
+
(function (PublishMetadataOptions) {
|
|
26
|
+
PublishMetadataOptions[PublishMetadataOptions["OnlyMetadataAPI"] = 0] = "OnlyMetadataAPI";
|
|
27
|
+
PublishMetadataOptions[PublishMetadataOptions["IPFS"] = 1] = "IPFS";
|
|
28
|
+
PublishMetadataOptions[PublishMetadataOptions["Filecoin"] = 2] = "Filecoin";
|
|
29
|
+
PublishMetadataOptions[PublishMetadataOptions["Arweave"] = 3] = "Arweave";
|
|
30
|
+
})(PublishMetadataOptions || (PublishMetadataOptions = {}));
|
|
31
|
+
/**
|
|
32
|
+
* It specifies if the DID will be published on-chain initially or not.
|
|
33
|
+
*/
|
|
34
|
+
export var PublishOnChainOptions;
|
|
35
|
+
(function (PublishOnChainOptions) {
|
|
36
|
+
PublishOnChainOptions[PublishOnChainOptions["DIDRegistry"] = 0] = "DIDRegistry";
|
|
37
|
+
PublishOnChainOptions[PublishOnChainOptions["OnlyOffchain"] = 1] = "OnlyOffchain";
|
|
38
|
+
})(PublishOnChainOptions || (PublishOnChainOptions = {}));
|
|
39
|
+
export class AssetPublicationOptions {
|
|
40
|
+
metadata = PublishMetadataOptions.OnlyMetadataAPI;
|
|
41
|
+
did = PublishOnChainOptions.DIDRegistry;
|
|
42
|
+
}
|
|
43
|
+
export var PermissionType;
|
|
44
|
+
(function (PermissionType) {
|
|
45
|
+
PermissionType["Read"] = "read";
|
|
46
|
+
PermissionType["Update"] = "update";
|
|
47
|
+
PermissionType["Delete"] = "delete";
|
|
48
|
+
PermissionType["Admin"] = "admin";
|
|
49
|
+
})(PermissionType || (PermissionType = {}));
|
|
50
|
+
export var PaymentMethodsAccepted;
|
|
51
|
+
(function (PaymentMethodsAccepted) {
|
|
52
|
+
PaymentMethodsAccepted["Crypto"] = "crypto";
|
|
53
|
+
PaymentMethodsAccepted["Fiat"] = "fiat";
|
|
54
|
+
PaymentMethodsAccepted["All"] = "all";
|
|
55
|
+
PaymentMethodsAccepted["NotSelected"] = "notSelected";
|
|
56
|
+
})(PaymentMethodsAccepted || (PaymentMethodsAccepted = {}));
|
|
57
|
+
export var State;
|
|
58
|
+
(function (State) {
|
|
59
|
+
State["Disabled"] = "disabled";
|
|
60
|
+
State["Unconfirmed"] = "unconfirmed";
|
|
61
|
+
State["Confirmed"] = "confirmed";
|
|
62
|
+
})(State || (State = {}));
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { OrganizationMemberRole } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for creating a user by organization (POST /account)
|
|
5
|
+
*/
|
|
6
|
+
export declare const CreateUserByOrganizationResponseDataSchema: z.ZodObject<{
|
|
7
|
+
walletResult: z.ZodObject<{
|
|
8
|
+
hash: z.ZodString;
|
|
9
|
+
userId: z.ZodString;
|
|
10
|
+
userWallet: z.ZodString;
|
|
11
|
+
alreadyMember: z.ZodBoolean;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
/**
|
|
15
|
+
* Schema for creating an organization (POST /organizations)
|
|
16
|
+
*/
|
|
17
|
+
export declare const CreateOrganizationResponseDataSchema: z.ZodObject<{
|
|
18
|
+
organization: z.ZodObject<{
|
|
19
|
+
orgId: z.ZodString;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
description: z.ZodOptional<z.ZodString>;
|
|
22
|
+
url: z.ZodOptional<z.ZodString>;
|
|
23
|
+
organizationWallet: z.ZodString;
|
|
24
|
+
cryptoFees: z.ZodString;
|
|
25
|
+
fiatFees: z.ZodString;
|
|
26
|
+
isActive: z.ZodBoolean;
|
|
27
|
+
createdAt: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
adminMember: z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
orgId: z.ZodString;
|
|
32
|
+
userId: z.ZodString;
|
|
33
|
+
userAddress: z.ZodString;
|
|
34
|
+
role: z.ZodEnum<typeof OrganizationMemberRole>;
|
|
35
|
+
isActive: z.ZodBoolean;
|
|
36
|
+
createdAt: z.ZodString;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
/**
|
|
40
|
+
* Schema for user organization info (GET /organizations/user-info/:userId)
|
|
41
|
+
*/
|
|
42
|
+
export declare const UserOrganizationInfoResponseDataSchema: z.ZodObject<{
|
|
43
|
+
userOrgInfo: z.ZodObject<{
|
|
44
|
+
orgId: z.ZodString;
|
|
45
|
+
userAddress: z.ZodString;
|
|
46
|
+
role: z.ZodEnum<typeof OrganizationMemberRole>;
|
|
47
|
+
userIsActive: z.ZodBoolean;
|
|
48
|
+
organizationIsActive: z.ZodBoolean;
|
|
49
|
+
organizationCryptoFees: z.ZodString;
|
|
50
|
+
organizationFiatFees: z.ZodString;
|
|
51
|
+
organizationOrganizationWallet: z.ZodString;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
/**
|
|
55
|
+
* Schema for single organization member data
|
|
56
|
+
*/
|
|
57
|
+
export declare const OrganizationMemberDataSchema: z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
orgId: z.ZodString;
|
|
60
|
+
userId: z.ZodString;
|
|
61
|
+
userAddress: z.ZodString;
|
|
62
|
+
role: z.ZodEnum<typeof OrganizationMemberRole>;
|
|
63
|
+
isActive: z.ZodBoolean;
|
|
64
|
+
createdAt: z.ZodString;
|
|
65
|
+
updatedAt: z.ZodString;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
/**
|
|
68
|
+
* Schema for organization members paginated response (POST /organizations/members)
|
|
69
|
+
*/
|
|
70
|
+
export declare const OrganizationMembersResponseDataSchema: z.ZodObject<{
|
|
71
|
+
totalResults: z.ZodNumber;
|
|
72
|
+
members: z.ZodArray<z.ZodObject<{
|
|
73
|
+
id: z.ZodString;
|
|
74
|
+
orgId: z.ZodString;
|
|
75
|
+
userId: z.ZodString;
|
|
76
|
+
userAddress: z.ZodString;
|
|
77
|
+
role: z.ZodEnum<typeof OrganizationMemberRole>;
|
|
78
|
+
isActive: z.ZodBoolean;
|
|
79
|
+
createdAt: z.ZodString;
|
|
80
|
+
updatedAt: z.ZodString;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
/**
|
|
86
|
+
* Schema for organization update response (PUT /organizations)
|
|
87
|
+
*/
|
|
88
|
+
export declare const UpdateOrganizationResponseDataSchema: z.ZodObject<{
|
|
89
|
+
organization: z.ZodObject<{
|
|
90
|
+
orgId: z.ZodString;
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
description: z.ZodOptional<z.ZodString>;
|
|
93
|
+
url: z.ZodOptional<z.ZodString>;
|
|
94
|
+
organizationWallet: z.ZodString;
|
|
95
|
+
cryptoFees: z.ZodString;
|
|
96
|
+
fiatFees: z.ZodString;
|
|
97
|
+
isActive: z.ZodBoolean;
|
|
98
|
+
updatedAt: z.ZodString;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
/**
|
|
102
|
+
* Schema for Branding object
|
|
103
|
+
*/
|
|
104
|
+
export declare const BrandingSchema: z.ZodObject<{
|
|
105
|
+
themeName: z.ZodOptional<z.ZodString>;
|
|
106
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
107
|
+
leftPanelHeadingTextColor: z.ZodOptional<z.ZodString>;
|
|
108
|
+
leftPanelBodyTextColor: z.ZodOptional<z.ZodString>;
|
|
109
|
+
leftPanelBackgroundColor1: z.ZodOptional<z.ZodString>;
|
|
110
|
+
leftPanelBackgroundColor2: z.ZodOptional<z.ZodString>;
|
|
111
|
+
leftPanelBackgroundImageUrl: z.ZodOptional<z.ZodString>;
|
|
112
|
+
rightCardTextColor: z.ZodOptional<z.ZodString>;
|
|
113
|
+
rightCardButtonBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
114
|
+
rightCardButtonTextColor: z.ZodOptional<z.ZodString>;
|
|
115
|
+
rightCardBackgroundColor1: z.ZodOptional<z.ZodString>;
|
|
116
|
+
rightCardBackgroundColor2: z.ZodOptional<z.ZodString>;
|
|
117
|
+
rightCardBackgroundImageUrl: z.ZodOptional<z.ZodString>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
/**
|
|
120
|
+
* Schema for organization branding response (GET/POST /organizations/branding)
|
|
121
|
+
*/
|
|
122
|
+
export declare const OrganizationBrandingResponseDataSchema: z.ZodObject<{
|
|
123
|
+
branding: z.ZodNullable<z.ZodObject<{
|
|
124
|
+
branding: z.ZodNullable<z.ZodObject<{
|
|
125
|
+
themeName: z.ZodOptional<z.ZodString>;
|
|
126
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
127
|
+
leftPanelHeadingTextColor: z.ZodOptional<z.ZodString>;
|
|
128
|
+
leftPanelBodyTextColor: z.ZodOptional<z.ZodString>;
|
|
129
|
+
leftPanelBackgroundColor1: z.ZodOptional<z.ZodString>;
|
|
130
|
+
leftPanelBackgroundColor2: z.ZodOptional<z.ZodString>;
|
|
131
|
+
leftPanelBackgroundImageUrl: z.ZodOptional<z.ZodString>;
|
|
132
|
+
rightCardTextColor: z.ZodOptional<z.ZodString>;
|
|
133
|
+
rightCardButtonBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
134
|
+
rightCardButtonTextColor: z.ZodOptional<z.ZodString>;
|
|
135
|
+
rightCardBackgroundColor1: z.ZodOptional<z.ZodString>;
|
|
136
|
+
rightCardBackgroundColor2: z.ZodOptional<z.ZodString>;
|
|
137
|
+
rightCardBackgroundImageUrl: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
name: z.ZodString;
|
|
140
|
+
url: z.ZodString;
|
|
141
|
+
}, z.core.$strip>>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
export type CreateUserByOrganizationResponseData = z.infer<typeof CreateUserByOrganizationResponseDataSchema>;
|
|
144
|
+
export type CreateOrganizationResponseData = z.infer<typeof CreateOrganizationResponseDataSchema>;
|
|
145
|
+
export type UserOrganizationInfoResponseData = z.infer<typeof UserOrganizationInfoResponseDataSchema>;
|
|
146
|
+
export type OrganizationMemberData = z.infer<typeof OrganizationMemberDataSchema>;
|
|
147
|
+
export type OrganizationMembersResponseData = z.infer<typeof OrganizationMembersResponseDataSchema>;
|
|
148
|
+
export type UpdateOrganizationResponseData = z.infer<typeof UpdateOrganizationResponseDataSchema>;
|
|
149
|
+
export type OrganizationBrandingResponseData = z.infer<typeof OrganizationBrandingResponseDataSchema>;
|
|
150
|
+
//# sourceMappingURL=OrganizationResponseTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationResponseTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/types/OrganizationResponseTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAMnD;;GAEG;AACH,eAAO,MAAM,0CAA0C;;;;;;;iBAOrD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;iBAqB/C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;iBAWjD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;iBASvC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;iBAKhD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;iBAY/C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;iBAczB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;iBAQjD,CAAA;AAMF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAA;AACD,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAA;AACjG,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACjF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,qCAAqC,CAC7C,CAAA;AACD,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAA;AACjG,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAA"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { OrganizationMemberRole } from './types.js';
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Zod Schemas for Response Data Types
|
|
5
|
+
// ============================================================================
|
|
6
|
+
/**
|
|
7
|
+
* Schema for creating a user by organization (POST /account)
|
|
8
|
+
*/
|
|
9
|
+
export const CreateUserByOrganizationResponseDataSchema = z.object({
|
|
10
|
+
walletResult: z.object({
|
|
11
|
+
hash: z.string(),
|
|
12
|
+
userId: z.string(),
|
|
13
|
+
userWallet: z.string(),
|
|
14
|
+
alreadyMember: z.boolean(),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Schema for creating an organization (POST /organizations)
|
|
19
|
+
*/
|
|
20
|
+
export const CreateOrganizationResponseDataSchema = z.object({
|
|
21
|
+
organization: z.object({
|
|
22
|
+
orgId: z.string(),
|
|
23
|
+
name: z.string(),
|
|
24
|
+
description: z.string().optional(),
|
|
25
|
+
url: z.string().optional(),
|
|
26
|
+
organizationWallet: z.string(),
|
|
27
|
+
cryptoFees: z.string(),
|
|
28
|
+
fiatFees: z.string(),
|
|
29
|
+
isActive: z.boolean(),
|
|
30
|
+
createdAt: z.string().datetime(),
|
|
31
|
+
}),
|
|
32
|
+
adminMember: z.object({
|
|
33
|
+
id: z.string(),
|
|
34
|
+
orgId: z.string(),
|
|
35
|
+
userId: z.string(),
|
|
36
|
+
userAddress: z.string(),
|
|
37
|
+
role: z.nativeEnum(OrganizationMemberRole),
|
|
38
|
+
isActive: z.boolean(),
|
|
39
|
+
createdAt: z.string().datetime(),
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* Schema for user organization info (GET /organizations/user-info/:userId)
|
|
44
|
+
*/
|
|
45
|
+
export const UserOrganizationInfoResponseDataSchema = z.object({
|
|
46
|
+
userOrgInfo: z.object({
|
|
47
|
+
orgId: z.string(),
|
|
48
|
+
userAddress: z.string(),
|
|
49
|
+
role: z.nativeEnum(OrganizationMemberRole),
|
|
50
|
+
userIsActive: z.boolean(),
|
|
51
|
+
organizationIsActive: z.boolean(),
|
|
52
|
+
organizationCryptoFees: z.string(),
|
|
53
|
+
organizationFiatFees: z.string(),
|
|
54
|
+
organizationOrganizationWallet: z.string(),
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Schema for single organization member data
|
|
59
|
+
*/
|
|
60
|
+
export const OrganizationMemberDataSchema = z.object({
|
|
61
|
+
id: z.string(),
|
|
62
|
+
orgId: z.string(),
|
|
63
|
+
userId: z.string(),
|
|
64
|
+
userAddress: z.string(),
|
|
65
|
+
role: z.nativeEnum(OrganizationMemberRole),
|
|
66
|
+
isActive: z.boolean(),
|
|
67
|
+
createdAt: z.string().datetime(),
|
|
68
|
+
updatedAt: z.string().datetime(),
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Schema for organization members paginated response (POST /organizations/members)
|
|
72
|
+
*/
|
|
73
|
+
export const OrganizationMembersResponseDataSchema = z.object({
|
|
74
|
+
totalResults: z.number(),
|
|
75
|
+
members: z.array(OrganizationMemberDataSchema),
|
|
76
|
+
page: z.number().optional(),
|
|
77
|
+
offset: z.number().optional(),
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* Schema for organization update response (PUT /organizations)
|
|
81
|
+
*/
|
|
82
|
+
export const UpdateOrganizationResponseDataSchema = z.object({
|
|
83
|
+
organization: z.object({
|
|
84
|
+
orgId: z.string(),
|
|
85
|
+
name: z.string(),
|
|
86
|
+
description: z.string().optional(),
|
|
87
|
+
url: z.string().optional(),
|
|
88
|
+
organizationWallet: z.string(),
|
|
89
|
+
cryptoFees: z.string(),
|
|
90
|
+
fiatFees: z.string(),
|
|
91
|
+
isActive: z.boolean(),
|
|
92
|
+
updatedAt: z.string().datetime(),
|
|
93
|
+
}),
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Schema for Branding object
|
|
97
|
+
*/
|
|
98
|
+
export const BrandingSchema = z.object({
|
|
99
|
+
themeName: z.string().optional(),
|
|
100
|
+
logo: z.string().optional(),
|
|
101
|
+
leftPanelHeadingTextColor: z.string().optional(),
|
|
102
|
+
leftPanelBodyTextColor: z.string().optional(),
|
|
103
|
+
leftPanelBackgroundColor1: z.string().optional(),
|
|
104
|
+
leftPanelBackgroundColor2: z.string().optional(),
|
|
105
|
+
leftPanelBackgroundImageUrl: z.string().optional(),
|
|
106
|
+
rightCardTextColor: z.string().optional(),
|
|
107
|
+
rightCardButtonBackgroundColor: z.string().optional(),
|
|
108
|
+
rightCardButtonTextColor: z.string().optional(),
|
|
109
|
+
rightCardBackgroundColor1: z.string().optional(),
|
|
110
|
+
rightCardBackgroundColor2: z.string().optional(),
|
|
111
|
+
rightCardBackgroundImageUrl: z.string().optional(),
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Schema for organization branding response (GET/POST /organizations/branding)
|
|
115
|
+
*/
|
|
116
|
+
export const OrganizationBrandingResponseDataSchema = z.object({
|
|
117
|
+
branding: z
|
|
118
|
+
.object({
|
|
119
|
+
branding: BrandingSchema.nullable(),
|
|
120
|
+
name: z.string(),
|
|
121
|
+
url: z.string(),
|
|
122
|
+
})
|
|
123
|
+
.nullable(),
|
|
124
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare enum Flavor {
|
|
2
|
+
Avatar = 0,
|
|
3
|
+
Cover = 1,
|
|
4
|
+
Animation = 2,
|
|
5
|
+
Image = 3,
|
|
6
|
+
Video = 4,
|
|
7
|
+
Audio = 5,
|
|
8
|
+
Terms = 6,
|
|
9
|
+
Private = 7,
|
|
10
|
+
SampleData = 8
|
|
11
|
+
}
|
|
12
|
+
export declare enum FlavorFolder {
|
|
13
|
+
Avatars = "avatars",
|
|
14
|
+
Covers = "covers",
|
|
15
|
+
Animations = "animations",
|
|
16
|
+
Images = "images",
|
|
17
|
+
Videos = "videos",
|
|
18
|
+
Audios = "audios",
|
|
19
|
+
Terms = "terms",
|
|
20
|
+
Privates = "private",
|
|
21
|
+
SampleData = "sample-data"
|
|
22
|
+
}
|
|
23
|
+
export declare enum TranscodingStatus {
|
|
24
|
+
Pending = "Pending",
|
|
25
|
+
Done = "Done",
|
|
26
|
+
Error = "Error"
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=TranscoderTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TranscoderTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/types/TranscoderTypes.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM;IAChB,MAAM,IAAI;IACV,KAAK,IAAI;IACT,SAAS,IAAI;IACb,KAAK,IAAI;IACT,KAAK,IAAI;IACT,KAAK,IAAI;IACT,KAAK,IAAI;IACT,OAAO,IAAI;IACX,UAAU,IAAI;CACf;AAED,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,QAAQ,YAAY;IACpB,UAAU,gBAAgB;CAC3B;AAED,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export var Flavor;
|
|
2
|
+
(function (Flavor) {
|
|
3
|
+
Flavor[Flavor["Avatar"] = 0] = "Avatar";
|
|
4
|
+
Flavor[Flavor["Cover"] = 1] = "Cover";
|
|
5
|
+
Flavor[Flavor["Animation"] = 2] = "Animation";
|
|
6
|
+
Flavor[Flavor["Image"] = 3] = "Image";
|
|
7
|
+
Flavor[Flavor["Video"] = 4] = "Video";
|
|
8
|
+
Flavor[Flavor["Audio"] = 5] = "Audio";
|
|
9
|
+
Flavor[Flavor["Terms"] = 6] = "Terms";
|
|
10
|
+
Flavor[Flavor["Private"] = 7] = "Private";
|
|
11
|
+
Flavor[Flavor["SampleData"] = 8] = "SampleData";
|
|
12
|
+
})(Flavor || (Flavor = {}));
|
|
13
|
+
export var FlavorFolder;
|
|
14
|
+
(function (FlavorFolder) {
|
|
15
|
+
FlavorFolder["Avatars"] = "avatars";
|
|
16
|
+
FlavorFolder["Covers"] = "covers";
|
|
17
|
+
FlavorFolder["Animations"] = "animations";
|
|
18
|
+
FlavorFolder["Images"] = "images";
|
|
19
|
+
FlavorFolder["Videos"] = "videos";
|
|
20
|
+
FlavorFolder["Audios"] = "audios";
|
|
21
|
+
FlavorFolder["Terms"] = "terms";
|
|
22
|
+
FlavorFolder["Privates"] = "private";
|
|
23
|
+
FlavorFolder["SampleData"] = "sample-data";
|
|
24
|
+
})(FlavorFolder || (FlavorFolder = {}));
|
|
25
|
+
export var TranscodingStatus;
|
|
26
|
+
(function (TranscodingStatus) {
|
|
27
|
+
TranscodingStatus["Pending"] = "Pending";
|
|
28
|
+
TranscodingStatus["Done"] = "Done";
|
|
29
|
+
TranscodingStatus["Error"] = "Error";
|
|
30
|
+
})(TranscodingStatus || (TranscodingStatus = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA"}
|