@nibgate/sdk 0.1.3 → 0.1.5
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 +1 -0
- package/package.json +1 -1
- package/src/core/resource.js +6 -1
- package/src/core/settings.js +2 -0
- package/src/index.d.ts +7 -0
- package/src/server.d.ts +8 -0
package/README.md
CHANGED
package/package.json
CHANGED
package/src/core/resource.js
CHANGED
|
@@ -77,7 +77,12 @@ export function normalizeResource(resource = {}) {
|
|
|
77
77
|
imageUrl: input.imageUrl || input.image || undefined,
|
|
78
78
|
tags: input.tags || undefined,
|
|
79
79
|
access: normalizeAccessPolicy(input.access),
|
|
80
|
-
unlock: normalizeUnlockPolicy(input.unlock)
|
|
80
|
+
unlock: normalizeUnlockPolicy(input.unlock),
|
|
81
|
+
ratingsEnabled: input.ratingsEnabled ?? input.enableRatings ?? input.reputation?.ratingsEnabled ?? true,
|
|
82
|
+
reputation: {
|
|
83
|
+
...(typeof input.reputation === 'object' && input.reputation ? input.reputation : {}),
|
|
84
|
+
ratingsEnabled: input.ratingsEnabled ?? input.enableRatings ?? input.reputation?.ratingsEnabled ?? true
|
|
85
|
+
}
|
|
81
86
|
};
|
|
82
87
|
}
|
|
83
88
|
|
package/src/core/settings.js
CHANGED
|
@@ -11,6 +11,7 @@ export const NIBGATE_CONTENT_SETTING_FIELDS = [
|
|
|
11
11
|
{ name: 'price', label: 'Price', type: 'text', defaultValue: '0.005' },
|
|
12
12
|
{ name: 'currency', label: 'Currency', type: 'text', defaultValue: 'USDC' },
|
|
13
13
|
{ name: 'recipient', label: 'Recipient wallet', type: 'wallet', defaultValue: '' },
|
|
14
|
+
{ name: 'ratingsEnabled', label: 'Enable ratings', type: 'boolean', defaultValue: true },
|
|
14
15
|
{ name: 'license', label: 'License / terms', type: 'textarea', defaultValue: '' }
|
|
15
16
|
];
|
|
16
17
|
|
|
@@ -31,6 +32,7 @@ export function createNibgateContentSettings(input = {}) {
|
|
|
31
32
|
price: String(input.price ?? input.amount ?? '0.005'),
|
|
32
33
|
currency: input.currency || 'USDC',
|
|
33
34
|
recipient: input.recipient || input.payTo || input.receiverAddress || input.creatorWallet || '',
|
|
35
|
+
ratingsEnabled: input.ratingsEnabled ?? input.enableRatings ?? input.reputation?.ratingsEnabled ?? true,
|
|
34
36
|
license: input.license || input.terms || ''
|
|
35
37
|
};
|
|
36
38
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -42,6 +42,12 @@ export type NibgateResource = {
|
|
|
42
42
|
tags?: readonly string[] | string;
|
|
43
43
|
access?: NibgateAccessMode | NibgateAccessPolicy;
|
|
44
44
|
unlock?: NibgateUnlockMode | NibgateUnlockPolicy;
|
|
45
|
+
ratingsEnabled?: boolean;
|
|
46
|
+
enableRatings?: boolean;
|
|
47
|
+
reputation?: {
|
|
48
|
+
ratingsEnabled?: boolean;
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
};
|
|
45
51
|
[key: string]: unknown;
|
|
46
52
|
};
|
|
47
53
|
|
|
@@ -380,6 +386,7 @@ export type NibgateContentSettings = {
|
|
|
380
386
|
price: string;
|
|
381
387
|
currency: string;
|
|
382
388
|
recipient: string;
|
|
389
|
+
ratingsEnabled: boolean;
|
|
383
390
|
license: string;
|
|
384
391
|
};
|
|
385
392
|
export declare const NIBGATE_CONTENT_SETTING_FIELDS: readonly NibgateContentSettingField[];
|
package/src/server.d.ts
CHANGED
|
@@ -22,6 +22,12 @@ export type NibgateServerResource = {
|
|
|
22
22
|
currency?: string;
|
|
23
23
|
access?: NibgateAccessMode | NibgateAccessPolicy;
|
|
24
24
|
unlock?: NibgateUnlockMode | NibgateUnlockPolicy;
|
|
25
|
+
ratingsEnabled?: boolean;
|
|
26
|
+
enableRatings?: boolean;
|
|
27
|
+
reputation?: {
|
|
28
|
+
ratingsEnabled?: boolean;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
};
|
|
25
31
|
[key: string]: unknown;
|
|
26
32
|
};
|
|
27
33
|
|
|
@@ -68,9 +74,11 @@ export type NibgateContentSettings = {
|
|
|
68
74
|
humanAccess: NibgateAccessMode;
|
|
69
75
|
agentAccess: NibgateAccessMode;
|
|
70
76
|
unlockMode: NibgateUnlockMode | string;
|
|
77
|
+
paymentRail: NibgatePaymentRail | string;
|
|
71
78
|
price: string;
|
|
72
79
|
currency: string;
|
|
73
80
|
recipient: string;
|
|
81
|
+
ratingsEnabled: boolean;
|
|
74
82
|
license: string;
|
|
75
83
|
};
|
|
76
84
|
export declare const NIBGATE_CONTENT_SETTING_FIELDS: readonly NibgateContentSettingField[];
|