@peable.to/contracts 0.2.1 → 0.3.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.
package/dist/cjs/index.js CHANGED
@@ -8,64 +8,76 @@ exports.contributionAmountSchema = zod_1.z
8
8
  .string()
9
9
  .regex(/^[1-9][0-9]{0,15}$/)
10
10
  .refine((v) => /^[1-9][0-9]{0,15}$/.test(v) && BigInt(v) <= 9007199254740991n, 'Enter a positive FairCoin base-unit amount within the supported range');
11
+ /** Every instant on the wire is integer Unix seconds (ADR 0014 D1). */
12
+ const unixSecondsSchema = zod_1.z.number().int().nonnegative();
11
13
  exports.contributionDetailsSchema = zod_1.z
12
14
  .object({
13
- organizationId: zod_1.z.string().min(1).max(200),
15
+ organization_id: zod_1.z.string().min(1).max(200),
14
16
  purpose: zod_1.z.string().trim().min(1).max(500),
15
- amountMode: zod_1.z.enum(['fixed', 'free']),
16
- expiresAt: zod_1.z.iso.datetime().nullable(),
17
+ amount_mode: zod_1.z.enum(['fixed', 'free']),
18
+ expires_at: unixSecondsSchema.nullable(),
17
19
  })
18
20
  .strict();
19
21
  exports.createContributionSchema = zod_1.z
20
22
  .object({
21
23
  purpose: exports.contributionDetailsSchema.shape.purpose,
22
- amountMode: exports.contributionDetailsSchema.shape.amountMode,
24
+ amount_mode: exports.contributionDetailsSchema.shape.amount_mode,
23
25
  amount: exports.contributionAmountSchema.optional(),
24
26
  currency: zod_1.z.literal('FAIR'),
25
- expiresAt: zod_1.z.iso.datetime().nullable().optional(),
27
+ expires_at: unixSecondsSchema.nullable().optional(),
26
28
  })
27
29
  .strict()
28
- .refine((v) => (v.amountMode === 'free' ? v.amount === undefined : v.amount !== undefined), 'Fixed contributions require an amount; free contributions omit it');
30
+ .refine((v) => (v.amount_mode === 'free' ? v.amount === undefined : v.amount !== undefined), 'Fixed contributions require an amount; free contributions omit it');
29
31
  exports.contributionLinkSchema = zod_1.z
30
32
  .object({
31
33
  id: zod_1.z.string(),
34
+ object: zod_1.z.literal('payment_link'),
32
35
  amount: zod_1.z.string(),
33
36
  currency: zod_1.z.literal('FAIR'),
34
37
  network: zod_1.z.enum(['mainnet', 'testnet']),
35
38
  active: zod_1.z.boolean(),
36
39
  url: zod_1.z.url(),
37
40
  contribution: exports.contributionDetailsSchema,
38
- createdAt: zod_1.z.iso.datetime(),
41
+ created: unixSecondsSchema,
39
42
  })
40
43
  .strict();
41
- exports.contributionListSchema = zod_1.z
42
- .object({ items: zod_1.z.array(exports.contributionLinkSchema), nextCursor: zod_1.z.string().nullable() })
43
- .strict();
44
+ /** The one list envelope (ADR 0014 D1). */
45
+ function listSchema(item) {
46
+ return zod_1.z
47
+ .object({ object: zod_1.z.literal('list'), data: zod_1.z.array(item), has_more: zod_1.z.boolean() })
48
+ .strict();
49
+ }
50
+ exports.contributionListSchema = listSchema(exports.contributionLinkSchema);
44
51
  exports.contributionCollectionSchema = zod_1.z
45
52
  .object({
46
53
  id: zod_1.z.string(),
54
+ object: zod_1.z.literal('payment_intent'),
47
55
  amount: zod_1.z.string(),
48
56
  currency: zod_1.z.literal('FAIR'),
49
57
  status: zod_1.z.string(),
50
- createdAt: zod_1.z.iso.datetime(),
51
- refundCapability: zod_1.z.literal('unsupported_non_custodial'),
58
+ created: unixSecondsSchema,
59
+ refund_capability: zod_1.z.literal('unsupported_non_custodial'),
52
60
  refunds: zod_1.z.array(zod_1.z
53
61
  .object({
54
62
  id: zod_1.z.string(),
63
+ object: zod_1.z.literal('refund'),
55
64
  amount: zod_1.z.string(),
56
65
  status: zod_1.z.string(),
57
- createdAt: zod_1.z.iso.datetime(),
66
+ created: unixSecondsSchema,
58
67
  })
59
68
  .strict()),
60
69
  })
61
70
  .strict();
62
- exports.contributionCollectionListSchema = zod_1.z
63
- .object({ items: zod_1.z.array(exports.contributionCollectionSchema), nextCursor: zod_1.z.string().nullable() })
64
- .strict();
71
+ exports.contributionCollectionListSchema = listSchema(exports.contributionCollectionSchema);
72
+ /**
73
+ * Paging: `starting_after` is the public id of the last object of the previous
74
+ * page (`link_…` for links, `pi_…` for collections), resolved by the gateway
75
+ * inside the caller's organization, application and environment.
76
+ */
65
77
  exports.contributionPageQuerySchema = zod_1.z
66
78
  .object({
67
- limit: zod_1.z.coerce.number().int().min(1).max(100).default(20),
68
- cursor: zod_1.z.string().max(1000).optional(),
79
+ limit: zod_1.z.coerce.number().int().min(1).max(100).default(10),
80
+ starting_after: zod_1.z.string().min(1).max(200).optional(),
69
81
  environment: zod_1.z.enum(['development', 'staging', 'production']),
70
82
  })
71
83
  .strict();
@@ -4,6 +4,12 @@ exports.contributionRoutes = void 0;
4
4
  exports.contributionOpenApi = contributionOpenApi;
5
5
  const zod_1 = require("zod");
6
6
  const index_1 = require("./index");
7
+ const requestIdHeader = {
8
+ 'Request-Id': {
9
+ description: 'Identifies this request to Peable support.',
10
+ schema: { type: 'string' },
11
+ },
12
+ };
7
13
  const path = '/v1/organizations/{organizationId}/applications/{applicationId}/contributions';
8
14
  exports.contributionRoutes = [
9
15
  {
@@ -58,8 +64,13 @@ function contributionOpenApi() {
58
64
  parameters.push({
59
65
  in: 'query',
60
66
  name: 'limit',
61
- schema: { type: 'integer', minimum: 1, maximum: 100, default: 20 },
62
- }, { in: 'query', name: 'cursor', schema: { type: 'string' } });
67
+ schema: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
68
+ }, {
69
+ in: 'query',
70
+ name: 'starting_after',
71
+ description: 'The id of the last object on the previous page.',
72
+ schema: { type: 'string' },
73
+ });
63
74
  if (route.method === 'post')
64
75
  parameters.push({
65
76
  in: 'header',
@@ -82,10 +93,12 @@ function contributionOpenApi() {
82
93
  responses: {
83
94
  [route.status]: {
84
95
  description: 'Success',
96
+ headers: requestIdHeader,
85
97
  content: { 'application/json': { schema: zod_1.z.toJSONSchema(route.response) } },
86
98
  },
87
99
  default: {
88
100
  description: 'Peable error envelope; HTTP status identifies failure',
101
+ headers: requestIdHeader,
89
102
  content: {
90
103
  'application/json': {
91
104
  schema: {
@@ -94,8 +107,14 @@ function contributionOpenApi() {
94
107
  properties: {
95
108
  error: {
96
109
  type: 'object',
97
- required: ['type', 'message'],
98
- properties: { type: { type: 'string' }, message: { type: 'string' } },
110
+ required: ['type', 'message', 'request_id'],
111
+ properties: {
112
+ type: { type: 'string' },
113
+ code: { type: 'string' },
114
+ param: { type: 'string' },
115
+ message: { type: 'string' },
116
+ request_id: { type: ['string', 'null'] },
117
+ },
99
118
  },
100
119
  },
101
120
  },
@@ -109,7 +128,7 @@ function contributionOpenApi() {
109
128
  openapi: '3.1.0',
110
129
  info: {
111
130
  title: 'Peable organization contributions',
112
- version: '0.1.0',
131
+ version: '0.2.0',
113
132
  description: 'One-off links. Human Oxy session for management; existing /v1/payment_links/{id}/public and /payment_intent remain anonymous. Fixed/free amounts use FAIR base units (8 decimals); the registered merchant determines the network. Refunds cannot be created by the watch-only gateway. No recurring billing.',
114
133
  },
115
134
  servers: [{ url: 'https://api.peable.to' }],
package/dist/esm/index.js CHANGED
@@ -3,64 +3,76 @@ export const contributionAmountSchema = z
3
3
  .string()
4
4
  .regex(/^[1-9][0-9]{0,15}$/)
5
5
  .refine((v) => /^[1-9][0-9]{0,15}$/.test(v) && BigInt(v) <= 9007199254740991n, 'Enter a positive FairCoin base-unit amount within the supported range');
6
+ /** Every instant on the wire is integer Unix seconds (ADR 0014 D1). */
7
+ const unixSecondsSchema = z.number().int().nonnegative();
6
8
  export const contributionDetailsSchema = z
7
9
  .object({
8
- organizationId: z.string().min(1).max(200),
10
+ organization_id: z.string().min(1).max(200),
9
11
  purpose: z.string().trim().min(1).max(500),
10
- amountMode: z.enum(['fixed', 'free']),
11
- expiresAt: z.iso.datetime().nullable(),
12
+ amount_mode: z.enum(['fixed', 'free']),
13
+ expires_at: unixSecondsSchema.nullable(),
12
14
  })
13
15
  .strict();
14
16
  export const createContributionSchema = z
15
17
  .object({
16
18
  purpose: contributionDetailsSchema.shape.purpose,
17
- amountMode: contributionDetailsSchema.shape.amountMode,
19
+ amount_mode: contributionDetailsSchema.shape.amount_mode,
18
20
  amount: contributionAmountSchema.optional(),
19
21
  currency: z.literal('FAIR'),
20
- expiresAt: z.iso.datetime().nullable().optional(),
22
+ expires_at: unixSecondsSchema.nullable().optional(),
21
23
  })
22
24
  .strict()
23
- .refine((v) => (v.amountMode === 'free' ? v.amount === undefined : v.amount !== undefined), 'Fixed contributions require an amount; free contributions omit it');
25
+ .refine((v) => (v.amount_mode === 'free' ? v.amount === undefined : v.amount !== undefined), 'Fixed contributions require an amount; free contributions omit it');
24
26
  export const contributionLinkSchema = z
25
27
  .object({
26
28
  id: z.string(),
29
+ object: z.literal('payment_link'),
27
30
  amount: z.string(),
28
31
  currency: z.literal('FAIR'),
29
32
  network: z.enum(['mainnet', 'testnet']),
30
33
  active: z.boolean(),
31
34
  url: z.url(),
32
35
  contribution: contributionDetailsSchema,
33
- createdAt: z.iso.datetime(),
36
+ created: unixSecondsSchema,
34
37
  })
35
38
  .strict();
36
- export const contributionListSchema = z
37
- .object({ items: z.array(contributionLinkSchema), nextCursor: z.string().nullable() })
38
- .strict();
39
+ /** The one list envelope (ADR 0014 D1). */
40
+ function listSchema(item) {
41
+ return z
42
+ .object({ object: z.literal('list'), data: z.array(item), has_more: z.boolean() })
43
+ .strict();
44
+ }
45
+ export const contributionListSchema = listSchema(contributionLinkSchema);
39
46
  export const contributionCollectionSchema = z
40
47
  .object({
41
48
  id: z.string(),
49
+ object: z.literal('payment_intent'),
42
50
  amount: z.string(),
43
51
  currency: z.literal('FAIR'),
44
52
  status: z.string(),
45
- createdAt: z.iso.datetime(),
46
- refundCapability: z.literal('unsupported_non_custodial'),
53
+ created: unixSecondsSchema,
54
+ refund_capability: z.literal('unsupported_non_custodial'),
47
55
  refunds: z.array(z
48
56
  .object({
49
57
  id: z.string(),
58
+ object: z.literal('refund'),
50
59
  amount: z.string(),
51
60
  status: z.string(),
52
- createdAt: z.iso.datetime(),
61
+ created: unixSecondsSchema,
53
62
  })
54
63
  .strict()),
55
64
  })
56
65
  .strict();
57
- export const contributionCollectionListSchema = z
58
- .object({ items: z.array(contributionCollectionSchema), nextCursor: z.string().nullable() })
59
- .strict();
66
+ export const contributionCollectionListSchema = listSchema(contributionCollectionSchema);
67
+ /**
68
+ * Paging: `starting_after` is the public id of the last object of the previous
69
+ * page (`link_…` for links, `pi_…` for collections), resolved by the gateway
70
+ * inside the caller's organization, application and environment.
71
+ */
60
72
  export const contributionPageQuerySchema = z
61
73
  .object({
62
- limit: z.coerce.number().int().min(1).max(100).default(20),
63
- cursor: z.string().max(1000).optional(),
74
+ limit: z.coerce.number().int().min(1).max(100).default(10),
75
+ starting_after: z.string().min(1).max(200).optional(),
64
76
  environment: z.enum(['development', 'staging', 'production']),
65
77
  })
66
78
  .strict();
@@ -1,5 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { createContributionSchema, contributionLinkSchema, contributionListSchema, contributionCollectionListSchema, contributionPatchSchema, } from './index.js';
3
+ const requestIdHeader = {
4
+ 'Request-Id': {
5
+ description: 'Identifies this request to Peable support.',
6
+ schema: { type: 'string' },
7
+ },
8
+ };
3
9
  const path = '/v1/organizations/{organizationId}/applications/{applicationId}/contributions';
4
10
  export const contributionRoutes = [
5
11
  {
@@ -54,8 +60,13 @@ export function contributionOpenApi() {
54
60
  parameters.push({
55
61
  in: 'query',
56
62
  name: 'limit',
57
- schema: { type: 'integer', minimum: 1, maximum: 100, default: 20 },
58
- }, { in: 'query', name: 'cursor', schema: { type: 'string' } });
63
+ schema: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
64
+ }, {
65
+ in: 'query',
66
+ name: 'starting_after',
67
+ description: 'The id of the last object on the previous page.',
68
+ schema: { type: 'string' },
69
+ });
59
70
  if (route.method === 'post')
60
71
  parameters.push({
61
72
  in: 'header',
@@ -78,10 +89,12 @@ export function contributionOpenApi() {
78
89
  responses: {
79
90
  [route.status]: {
80
91
  description: 'Success',
92
+ headers: requestIdHeader,
81
93
  content: { 'application/json': { schema: z.toJSONSchema(route.response) } },
82
94
  },
83
95
  default: {
84
96
  description: 'Peable error envelope; HTTP status identifies failure',
97
+ headers: requestIdHeader,
85
98
  content: {
86
99
  'application/json': {
87
100
  schema: {
@@ -90,8 +103,14 @@ export function contributionOpenApi() {
90
103
  properties: {
91
104
  error: {
92
105
  type: 'object',
93
- required: ['type', 'message'],
94
- properties: { type: { type: 'string' }, message: { type: 'string' } },
106
+ required: ['type', 'message', 'request_id'],
107
+ properties: {
108
+ type: { type: 'string' },
109
+ code: { type: 'string' },
110
+ param: { type: 'string' },
111
+ message: { type: 'string' },
112
+ request_id: { type: ['string', 'null'] },
113
+ },
95
114
  },
96
115
  },
97
116
  },
@@ -105,7 +124,7 @@ export function contributionOpenApi() {
105
124
  openapi: '3.1.0',
106
125
  info: {
107
126
  title: 'Peable organization contributions',
108
- version: '0.1.0',
127
+ version: '0.2.0',
109
128
  description: 'One-off links. Human Oxy session for management; existing /v1/payment_links/{id}/public and /payment_intent remain anonymous. Fixed/free amounts use FAIR base units (8 decimals); the registered merchant determines the network. Refunds cannot be created by the watch-only gateway. No recurring billing.',
110
129
  },
111
130
  servers: [{ url: 'https://api.peable.to' }],
@@ -1,28 +1,29 @@
1
1
  import { z } from 'zod';
2
2
  export declare const contributionAmountSchema: z.ZodString;
3
3
  export declare const contributionDetailsSchema: z.ZodObject<{
4
- organizationId: z.ZodString;
4
+ organization_id: z.ZodString;
5
5
  purpose: z.ZodString;
6
- amountMode: z.ZodEnum<{
6
+ amount_mode: z.ZodEnum<{
7
7
  fixed: "fixed";
8
8
  free: "free";
9
9
  }>;
10
- expiresAt: z.ZodNullable<z.ZodISODateTime>;
10
+ expires_at: z.ZodNullable<z.ZodNumber>;
11
11
  }, z.core.$strict>;
12
12
  export type ContributionDetails = z.infer<typeof contributionDetailsSchema>;
13
13
  export declare const createContributionSchema: z.ZodObject<{
14
14
  purpose: z.ZodString;
15
- amountMode: z.ZodEnum<{
15
+ amount_mode: z.ZodEnum<{
16
16
  fixed: "fixed";
17
17
  free: "free";
18
18
  }>;
19
19
  amount: z.ZodOptional<z.ZodString>;
20
20
  currency: z.ZodLiteral<"FAIR">;
21
- expiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
21
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
22
22
  }, z.core.$strict>;
23
23
  export type CreateContribution = z.infer<typeof createContributionSchema>;
24
24
  export declare const contributionLinkSchema: z.ZodObject<{
25
25
  id: z.ZodString;
26
+ object: z.ZodLiteral<"payment_link">;
26
27
  amount: z.ZodString;
27
28
  currency: z.ZodLiteral<"FAIR">;
28
29
  network: z.ZodEnum<{
@@ -32,20 +33,22 @@ export declare const contributionLinkSchema: z.ZodObject<{
32
33
  active: z.ZodBoolean;
33
34
  url: z.ZodURL;
34
35
  contribution: z.ZodObject<{
35
- organizationId: z.ZodString;
36
+ organization_id: z.ZodString;
36
37
  purpose: z.ZodString;
37
- amountMode: z.ZodEnum<{
38
+ amount_mode: z.ZodEnum<{
38
39
  fixed: "fixed";
39
40
  free: "free";
40
41
  }>;
41
- expiresAt: z.ZodNullable<z.ZodISODateTime>;
42
+ expires_at: z.ZodNullable<z.ZodNumber>;
42
43
  }, z.core.$strict>;
43
- createdAt: z.ZodISODateTime;
44
+ created: z.ZodNumber;
44
45
  }, z.core.$strict>;
45
46
  export type ContributionLink = z.infer<typeof contributionLinkSchema>;
46
47
  export declare const contributionListSchema: z.ZodObject<{
47
- items: z.ZodArray<z.ZodObject<{
48
+ object: z.ZodLiteral<"list">;
49
+ data: z.ZodArray<z.ZodObject<{
48
50
  id: z.ZodString;
51
+ object: z.ZodLiteral<"payment_link">;
49
52
  amount: z.ZodString;
50
53
  currency: z.ZodLiteral<"FAIR">;
51
54
  network: z.ZodEnum<{
@@ -55,52 +58,64 @@ export declare const contributionListSchema: z.ZodObject<{
55
58
  active: z.ZodBoolean;
56
59
  url: z.ZodURL;
57
60
  contribution: z.ZodObject<{
58
- organizationId: z.ZodString;
61
+ organization_id: z.ZodString;
59
62
  purpose: z.ZodString;
60
- amountMode: z.ZodEnum<{
63
+ amount_mode: z.ZodEnum<{
61
64
  fixed: "fixed";
62
65
  free: "free";
63
66
  }>;
64
- expiresAt: z.ZodNullable<z.ZodISODateTime>;
67
+ expires_at: z.ZodNullable<z.ZodNumber>;
65
68
  }, z.core.$strict>;
66
- createdAt: z.ZodISODateTime;
69
+ created: z.ZodNumber;
67
70
  }, z.core.$strict>>;
68
- nextCursor: z.ZodNullable<z.ZodString>;
71
+ has_more: z.ZodBoolean;
69
72
  }, z.core.$strict>;
73
+ export type ContributionList = z.infer<typeof contributionListSchema>;
70
74
  export declare const contributionCollectionSchema: z.ZodObject<{
71
75
  id: z.ZodString;
76
+ object: z.ZodLiteral<"payment_intent">;
72
77
  amount: z.ZodString;
73
78
  currency: z.ZodLiteral<"FAIR">;
74
79
  status: z.ZodString;
75
- createdAt: z.ZodISODateTime;
76
- refundCapability: z.ZodLiteral<"unsupported_non_custodial">;
80
+ created: z.ZodNumber;
81
+ refund_capability: z.ZodLiteral<"unsupported_non_custodial">;
77
82
  refunds: z.ZodArray<z.ZodObject<{
78
83
  id: z.ZodString;
84
+ object: z.ZodLiteral<"refund">;
79
85
  amount: z.ZodString;
80
86
  status: z.ZodString;
81
- createdAt: z.ZodISODateTime;
87
+ created: z.ZodNumber;
82
88
  }, z.core.$strict>>;
83
89
  }, z.core.$strict>;
90
+ export type ContributionCollection = z.infer<typeof contributionCollectionSchema>;
84
91
  export declare const contributionCollectionListSchema: z.ZodObject<{
85
- items: z.ZodArray<z.ZodObject<{
92
+ object: z.ZodLiteral<"list">;
93
+ data: z.ZodArray<z.ZodObject<{
86
94
  id: z.ZodString;
95
+ object: z.ZodLiteral<"payment_intent">;
87
96
  amount: z.ZodString;
88
97
  currency: z.ZodLiteral<"FAIR">;
89
98
  status: z.ZodString;
90
- createdAt: z.ZodISODateTime;
91
- refundCapability: z.ZodLiteral<"unsupported_non_custodial">;
99
+ created: z.ZodNumber;
100
+ refund_capability: z.ZodLiteral<"unsupported_non_custodial">;
92
101
  refunds: z.ZodArray<z.ZodObject<{
93
102
  id: z.ZodString;
103
+ object: z.ZodLiteral<"refund">;
94
104
  amount: z.ZodString;
95
105
  status: z.ZodString;
96
- createdAt: z.ZodISODateTime;
106
+ created: z.ZodNumber;
97
107
  }, z.core.$strict>>;
98
108
  }, z.core.$strict>>;
99
- nextCursor: z.ZodNullable<z.ZodString>;
109
+ has_more: z.ZodBoolean;
100
110
  }, z.core.$strict>;
111
+ /**
112
+ * Paging: `starting_after` is the public id of the last object of the previous
113
+ * page (`link_…` for links, `pi_…` for collections), resolved by the gateway
114
+ * inside the caller's organization, application and environment.
115
+ */
101
116
  export declare const contributionPageQuerySchema: z.ZodObject<{
102
117
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
103
- cursor: z.ZodOptional<z.ZodString>;
118
+ starting_after: z.ZodOptional<z.ZodString>;
104
119
  environment: z.ZodEnum<{
105
120
  development: "development";
106
121
  staging: "staging";
@@ -5,16 +5,17 @@ export declare const contributionRoutes: readonly [{
5
5
  readonly operationId: "createContribution";
6
6
  readonly body: z.ZodObject<{
7
7
  purpose: z.ZodString;
8
- amountMode: z.ZodEnum<{
8
+ amount_mode: z.ZodEnum<{
9
9
  fixed: "fixed";
10
10
  free: "free";
11
11
  }>;
12
12
  amount: z.ZodOptional<z.ZodString>;
13
13
  currency: z.ZodLiteral<"FAIR">;
14
- expiresAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
14
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
15
15
  }, z.core.$strict>;
16
16
  readonly response: z.ZodObject<{
17
17
  id: z.ZodString;
18
+ object: z.ZodLiteral<"payment_link">;
18
19
  amount: z.ZodString;
19
20
  currency: z.ZodLiteral<"FAIR">;
20
21
  network: z.ZodEnum<{
@@ -24,15 +25,15 @@ export declare const contributionRoutes: readonly [{
24
25
  active: z.ZodBoolean;
25
26
  url: z.ZodURL;
26
27
  contribution: z.ZodObject<{
27
- organizationId: z.ZodString;
28
+ organization_id: z.ZodString;
28
29
  purpose: z.ZodString;
29
- amountMode: z.ZodEnum<{
30
+ amount_mode: z.ZodEnum<{
30
31
  fixed: "fixed";
31
32
  free: "free";
32
33
  }>;
33
- expiresAt: z.ZodNullable<z.ZodISODateTime>;
34
+ expires_at: z.ZodNullable<z.ZodNumber>;
34
35
  }, z.core.$strict>;
35
- createdAt: z.ZodISODateTime;
36
+ created: z.ZodNumber;
36
37
  }, z.core.$strict>;
37
38
  readonly status: 201;
38
39
  }, {
@@ -40,8 +41,10 @@ export declare const contributionRoutes: readonly [{
40
41
  readonly path: "/v1/organizations/{organizationId}/applications/{applicationId}/contributions";
41
42
  readonly operationId: "listContributions";
42
43
  readonly response: z.ZodObject<{
43
- items: z.ZodArray<z.ZodObject<{
44
+ object: z.ZodLiteral<"list">;
45
+ data: z.ZodArray<z.ZodObject<{
44
46
  id: z.ZodString;
47
+ object: z.ZodLiteral<"payment_link">;
45
48
  amount: z.ZodString;
46
49
  currency: z.ZodLiteral<"FAIR">;
47
50
  network: z.ZodEnum<{
@@ -51,17 +54,17 @@ export declare const contributionRoutes: readonly [{
51
54
  active: z.ZodBoolean;
52
55
  url: z.ZodURL;
53
56
  contribution: z.ZodObject<{
54
- organizationId: z.ZodString;
57
+ organization_id: z.ZodString;
55
58
  purpose: z.ZodString;
56
- amountMode: z.ZodEnum<{
59
+ amount_mode: z.ZodEnum<{
57
60
  fixed: "fixed";
58
61
  free: "free";
59
62
  }>;
60
- expiresAt: z.ZodNullable<z.ZodISODateTime>;
63
+ expires_at: z.ZodNullable<z.ZodNumber>;
61
64
  }, z.core.$strict>;
62
- createdAt: z.ZodISODateTime;
65
+ created: z.ZodNumber;
63
66
  }, z.core.$strict>>;
64
- nextCursor: z.ZodNullable<z.ZodString>;
67
+ has_more: z.ZodBoolean;
65
68
  }, z.core.$strict>;
66
69
  readonly status: 200;
67
70
  }, {
@@ -73,6 +76,7 @@ export declare const contributionRoutes: readonly [{
73
76
  }, z.core.$strict>;
74
77
  readonly response: z.ZodObject<{
75
78
  id: z.ZodString;
79
+ object: z.ZodLiteral<"payment_link">;
76
80
  amount: z.ZodString;
77
81
  currency: z.ZodLiteral<"FAIR">;
78
82
  network: z.ZodEnum<{
@@ -82,15 +86,15 @@ export declare const contributionRoutes: readonly [{
82
86
  active: z.ZodBoolean;
83
87
  url: z.ZodURL;
84
88
  contribution: z.ZodObject<{
85
- organizationId: z.ZodString;
89
+ organization_id: z.ZodString;
86
90
  purpose: z.ZodString;
87
- amountMode: z.ZodEnum<{
91
+ amount_mode: z.ZodEnum<{
88
92
  fixed: "fixed";
89
93
  free: "free";
90
94
  }>;
91
- expiresAt: z.ZodNullable<z.ZodISODateTime>;
95
+ expires_at: z.ZodNullable<z.ZodNumber>;
92
96
  }, z.core.$strict>;
93
- createdAt: z.ZodISODateTime;
97
+ created: z.ZodNumber;
94
98
  }, z.core.$strict>;
95
99
  readonly status: 200;
96
100
  }, {
@@ -98,21 +102,24 @@ export declare const contributionRoutes: readonly [{
98
102
  readonly path: "/v1/organizations/{organizationId}/applications/{applicationId}/contributions/{id}/collections";
99
103
  readonly operationId: "listContributionCollections";
100
104
  readonly response: z.ZodObject<{
101
- items: z.ZodArray<z.ZodObject<{
105
+ object: z.ZodLiteral<"list">;
106
+ data: z.ZodArray<z.ZodObject<{
102
107
  id: z.ZodString;
108
+ object: z.ZodLiteral<"payment_intent">;
103
109
  amount: z.ZodString;
104
110
  currency: z.ZodLiteral<"FAIR">;
105
111
  status: z.ZodString;
106
- createdAt: z.ZodISODateTime;
107
- refundCapability: z.ZodLiteral<"unsupported_non_custodial">;
112
+ created: z.ZodNumber;
113
+ refund_capability: z.ZodLiteral<"unsupported_non_custodial">;
108
114
  refunds: z.ZodArray<z.ZodObject<{
109
115
  id: z.ZodString;
116
+ object: z.ZodLiteral<"refund">;
110
117
  amount: z.ZodString;
111
118
  status: z.ZodString;
112
- createdAt: z.ZodISODateTime;
119
+ created: z.ZodNumber;
113
120
  }, z.core.$strict>>;
114
121
  }, z.core.$strict>>;
115
- nextCursor: z.ZodNullable<z.ZodString>;
122
+ has_more: z.ZodBoolean;
116
123
  }, z.core.$strict>;
117
124
  readonly status: 200;
118
125
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peable.to/contracts",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Validated Peable contribution-link contracts",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",